Alienhead Posted May 18, 2024 Share Posted May 18, 2024 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 Alienhead Components and Software Link to comment Share on other sites More sharing options...
Alienhead Posted May 18, 2024 Author Share Posted May 18, 2024 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 Alienhead Components and Software Link to comment Share on other sites More sharing options...
Alienhead Posted May 18, 2024 Author Share Posted May 18, 2024 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 Alienhead Components and Software Link to comment Share on other sites More sharing options...
Alienhead Posted May 18, 2024 Author Share Posted May 18, 2024 Adding to this list: navagent:Stop() is missing in lua. Quote Alienhead Components and Software Link to comment Share on other sites More sharing options...
Alienhead Posted May 18, 2024 Author Share Posted May 18, 2024 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 Alienhead Components and Software Link to comment Share on other sites More sharing options...
Solution Josh Posted May 19, 2024 Solution Share Posted May 19, 2024 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.