How to manually rebuild the Nav Mesh

Hey Everyone,

Can anyone help me with manually rebuilding the nav mesh? I will take C++ or Blueprints and even pointers to relevant answers or forum posts etc would be helpful.

By the way I know that the Nav Mesh can rebuild itself at runtime but that doesn’t work for this scenario and I need to be able to manually rebuild it.

Thanks in advance

You can use Execute Console Command node with parameter “RebuildNavigation”.
I don’t know if there’s a better way to do it, but this should work for you.

1 Like

I haven’t tried the RebuildNavigation command but I found that if you tick the ForceRebuildOnLoad option in the RecastNavMesh-Default that should appear in the scene out liner then it appears to work for what I needed it to do as I just needed it to generate the navmesh at the start of the game. I will however try the console command in case I want to regenerate it later on in the game.

A possible way by using C++

UNavigationSystemV1* navigation_system = UNavigationSystemV1::GetCurrent(GetWorld());

if (navigation_system)
    navigation_system->Build();

Tested with UE4.24

4 Likes

RebuildNavigation is generating a Command Not Found error when used from C++ but works when I run it from the editor for me

Hello, isure you have a nav mesh bound volume in your map first, that was my mistake, then simply go to build, and scroll down to build paths. fixed my problem. (do not hit build all leveles as it does not build all those things below then need to be individually selected