Handling Static Navmesh Obstacles

For the current project I am working on we have a very large generated terrain area, with trees placed on top. Currently we have all the trees set as navmesh obstacles that carve out an area of the navmesh

Because there are so many trees, navmesh carving is attributing to nearly half the processing time every frame in our model. Is there a way to make it so that Navmesh obstacles that are always static do not need to keep carving every frame?

Or, if we only want to generate the navmesh because none of the obstacles move, is there a way to stop it updating so often and triggering it to carve again?

You don’t need to use navmesh obstacles for this. Just a simple collider will do.
Just put a capsule or box collider for the tree trunk, give it a layer like “obstacle”
Then in navmesh surface set it to use Physics colliders and set the include layers to include the physics layer “obstacle”.
You can use any name you’d like.
I think you should only use carving if an object moves, like a platform that goes left or right.
For static objects like trees this should work perfectly

3 Likes

The first method does not work with trees added using Terrain Tools trees. Is there a way to do that with AI Navigation yet?