Alienhead Posted May 18 Share Posted May 18 Is NavMesh creation currently turned off in the editor? Nothing happens whatsoever when I click Build NavMesh. just wondering Strike that, I just realized I was doing it wrong. 1 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted May 18 Author Share Posted May 18 Josh, can you expose the NavMesh class to lua? I need to access an editor created Navmesh but i cant cast it and lua thinks its Entity class. So CreateNavAgent(navmesh) fails. navmesh = NavMesh(navmesh) or nav:As<NavMesh>() Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted May 18 Author Share Posted May 18 Also trying to mimic the creation in code results with an error: navmesh = CreateNavMesh(world, 100, 64, 64, 32, 0.25, 0.4, 1.8, 0.5, 45) CreateNavMesh(shared_ptr<World> world, const float height, const int tilesx, const int tilesz, const int tileres = 32, const float voxelsize = 0.25, const float agentradius = 0.4, const float agentheight = 1.8, const float stepheight = 0.501, const float maxslope = 45.01) Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted May 18 Author Share Posted May 18 Adding to this list: navagent:Stop() is missing in lua. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted May 18 Author Share Posted May 18 Adding to this list: In order for me to attach a NavAgent to a entity already in the world I have to move the entity to 0,0,0 and rotation 0,0,0 then attach it, then SetPosition() and SetRotation() the agent back to the normal spot for it to work. Simply creating the agent, moving it to pos and rot then attaching it causes some weird effects usually resulting in the model/entity being placed all about the map. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Solution Josh Posted May 19 Solution Share Posted May 19 Added NavAgent:Stop Added NavMesh() casting function Added the missing CreateNavMesh overload These will be included in the next build that goes up. On 5/18/2024 at 9:45 AM, Alienhead said: In order for me to attach a NavAgent to a entity already in the world I have to move the entity to 0,0,0 and rotation 0,0,0 then attach it, then SetPosition() and SetRotation() the agent back to the normal spot for it to work. Simply creating the agent, moving it to pos and rot then attaching it causes some weird effects usually resulting in the model/entity being placed all about the map. When an entity is attached to an object, it's local orientation is preserved relative to the parent. This might be a design decision that should be revisited, but it is currently working as intended. I don't think you need to move the agent, the entity's global orientation at the time of attachment will turn into its relative orientation to the attached object. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.