Navmesh runtime regeneration

I’ve put in a NavmeshBoundsVolume in my map. My question is regarding the recalculation of Navmesh on-demand from my C++ code. Is there any avenue to do so?

I know of the

setting in DefaultEngine.ini. But this happens on changing any Dynamic object in the environment. There might be scenarios I want it to be recalculated only in specific situations, not every time. Is there a way to do so through code? Maybe call an event or something …

You’ll need to manually lock and unlock navmesh generation using UNavigationSystem::AddNavigationBuildLock and UNavigationSystem::RemoveNavigationBuildLock. Navigation needs to be configured for Dynamic generation for it to work.



Thanks Mieszko! I’ll try it in this upcoming week. Your prompt responses are a life-saver!

Maybe I’m missing something but “RemoveNavigationBuildLock” wants to rebuild the entire navmesh. I see there’s a skiprebuild flag but only for the editor. Is there a way to circumvent this? I do not want to rebuild my entire navmesh, only dirty tiles.