Any plans to add an option to allow nav mesh modifiers to update the nav mesh at run time similar to the nav mesh obstacle “carve” option?
Or what would be the lowest cost way to update the nav Mesh at run time like every frame or every x number of frames? I have fast moving objects that I want agents to react to. I have them set as obstacles right now set to constantly carve but it’s messing with my collisions. The collisions worked fine in 5.6 but updating to 2017.1 jacked it up. I’m trying to do a reliable repro project for a bug report…
Fast moving objects should use NavMeshObstacles imo, baking the navmesh every frame won’t be fast enough if you have a bigger terrain/level. Could you go more in detail (or post a gif) about your collision problems? I have not yet run into any problems regarding the NavMeshObstacles.
You could also try the newest 2017.2beta10 or 11, they have made significant improvements on the navmesh rebaking performance, but I am not sure if this is just for travel costs changes or the whole rebaking as I have tested only travel cost changes.
Thx! In your experience, what’s the most performant way to update the travel cost changes with the navmeshSurface?
For travel cost changes I would suggest using the LocalNavMeshBuilder instead of the NavMeshSurface. Just look at the code for the NavMeshSurface, it’s really not optimized for frequent rebakes in runtime.
If you really want to optimize it, I would actually suggest writing your own LocalNavMeshBuilder as I did. You can do some optimizations like collecting sources in a coroutine or collect only travel cost changes and cache all the other data, if it is static etc.