Nav Mesh problems/disappearing


On my project we are having some issues with navigation meshes. For example actors cannot navigate unless you regenerate the navigation mesh before playing in the editor, even though the navigation mesh looks fine in the editor.

I am under the impression that a lot of these problems are caused because we do not automatically generate the navigation meshes for our project. This did let me find some interesting problems. In some cases when saving a level the navigation mesh gets lost entirely. Here is the test case:

Under Editor Preferences → Level Editor → Disable Update Navigation Automatically

  1. Open a test level and build the navigation mesh for it. Build → Build paths.
  2. Enable the paths so they are visible in the editor (P by default).
  3. Observe the navigation mesh is there.
  4. Save the level.
  5. Restart the editor and load the level.
  6. Observe the navigation mesh is still there.
  7. Make a change in the level blueprint and save the blueprint.
  8. Restart the editor and load the level.
  9. Observe the navigation mesh is gone.

Running our project the debugger tells me that the AI fails to navigate because FPImplRecastNavMesh::ProjectPointToNavMesh fails on DetourNavMesh == NULL. Yet this doesn’t explain why the nav mesh goes missing if you save the level without regenerating the nav mesh. So I really don’t want to fix this problem as the problem seems to be elsewhere. It looks like not everything is being loaded properly in some cases.

Anyone have any ideas on what I can do to fix this?

Hey Didek,

Thank you for your report. I was able to reproduce this exactly as you have described and have entered a report to our Navigation/AI team. Please let us know if you encounter any other unexpected behavior.


Some updates on this issue. The DetourNavMesh is not loaded because ARecastNavMesh::SerializeRecastNavMesh checks if there are dirty areas. If there are dirty areas the Nav Mesh is not loaded.

When a level is loaded it adds the level collision to the Octree in UNavigationSystem::AddLevelCollisionToOctree. Every time a node is added it is also added to the dirty areas array and thus preventing the Nav Mesh from being loaded.

Wouldn’t it make more sense if this is only done if no navigation data is found? Even better would be just allowing the user to run with outdated navigation data, because having to rebuild it every time seems a bit redundant.

Hi Antonio,

It looks like this has been fixed internally, though the fix still needs testing. It won’t make it into 4.6 at this point, but will likely appear in 4.7.

Hello, Didek.

Maybe fix this in 4.6.0?

This issue stop my game development, i’m wasting my time !!! :frowning:

Can you please show link to this issue, it on github?

I’m very-very-very waiting this fix!

Project Settings
Navigation Mesh > Runtime > Force Rebuild on Load = true

I had this problem in 4.22 in case anyone else is searching this 2014 thread :wink:
The above setting sorted it out, though it may have some ramifications.