Lag spike when navmesh cutting

When I place an object in the scene that has a Dynamic grid obstacle attached to it, I get a 300+ ms frame:

I am using a recast graph.
I thought that navmesh cutting just cut a hole in the mesh, but I see that there is an item “Find Meshes for rasterization”.
What am I doing wrong here?



A DynamicGridObstacle will recalculate the navmesh around itself whenever it moves (or is created/destroyed). If you only want to use navmesh cutting then you should remove the DynamicGridObstacle component.

1 Like

Oh okay, that is great to know.

So DynamicGridObstacles would be for items that do not cut the mesh but are to be avoided by the agents, is that correct? and is the rasterization expected for this?


DynamicGridObstacles is for when you want to recalculate the graph from scratch in that region. Navmesh cuts are nice for obstacles that only cut the navmesh, but they can only cut it. They cannot add a new part of the navmesh and they also require you to specify the exact shape which may be tedious.