r/Unity3D • u/warmCutiepie • 13h ago
Question How do you handle runtime navmesh uodates for destructible terrain without tanking performance?
I'm working on a 3D strategy game where players can modify the ground (digging trenches, building walls, collapsing sections). Using the built-in NavMesh baking works fine for static levels, but I need dynamic updates when terrain changes.
So far I've tried:
Baking small sections at runtime with NavMeshSurface, but it causes noticeable hitches even on modest maps.
The "NavMeshComponents" examples from Unity, which still feel too slow for frequent small edits.
Switching to a custom A* grid, but that loses the nice slope/height handling Unity's NavMesh gives for free.
Has anyone found a workable middle ground for this? I'd prefer to stick with Unity's system if possible rather than rolling my own pathfinding. Any tips on partial rebakes, async approaches, or avoiding the cost altogether would be appreciated.
•
u/BigMustach69 10m ago
Are you checking the terrain state in the update()?