UNavigationSystem Why MainNavData is null?

I am accessing my NavMesh with the following code:

static UNavigationSystem* const NavMesh = UNavigationSystem::GetCurrent(GetWorld());

But in debug MainNavData is NULL, but in the editor I have a fully set NavMeshBoundsVolume ( As you can see on pic 2)

What could be the problem? Without MainNavData I cant generate points for my characters

I Am used GetMainNavData(), but it’s still null.

It all boils down to when you access the MainNavData. It gets set lazily, meaning if it’s null when you try to get it (via the GetMainNavData getter) the registered navigation data instances will be traversed and main one will be picked. Try postponing your MainNavData use and see if it helps.

Cheers,

–mieszko

Hello,

Am confused when to use MainNavData and AbstractNavData, other than the code comments I haven’t found any documentation.
We are experiencing problems in cooked builds when accessing AbstractNavData.

Switching to MainNavData solves the problem but breaks a different stuff in our navigation .

EDIT: apparently doing a full rebuild and cook fixes our problem. Is it always recommended to enable FullRebuild ? We discuss that for the changes we are making content wise, shouldn’t be necessary