Navmesh doesn't seem to work when deploying on android after calling Open Level

Hi there,

I currently have a project with three levels, two of which have a large navmesh area. The functionality I’m after is that I click a button and I have an NPC spawn in front of me and guide me to a pre-defined point on the level. The problem that I’m currently encountering is that when I go between levels on my Android device, the NPC is spawned in instantaneously and then disappears without guiding the player (The disappearing functionality is just what it does when it reaches the end of its path). From what I can tell, this is due to the navmesh not being built (As the functionality works normally if I start off in a level with a navmesh.).

Just as an example of what’s going on:

  1. My player starts in world A. This has a navmesh in it. I can spawn the AI and have it lead me to the predefined point on the map.
  2. I use the Open Level function to open to world B. This also has a navmesh, however the AI that I spawn no longer travels on the navmesh and disappears.
  3. I can go back to world A and the navmesh will still be functioning.

My current assumption is that the android device that I’m using is just taking forever to build the navmesh when a level is loaded that isn’t the initial level, however if anyone could provide some insight into what may be going on it would be greatly appreciated.

I have the similar issue, after testing many ways, when I run it on my Android device, AI cannot move because navmesh seems missing. I have tested on PC, everything is okay, I tried many ways, I started to suspect NavMesh not being able to build on Android ETC2 or something.

After many tests, I have changed the Project Settings NavMesh from Static to Dynamic and it seems working okay on Android. Only one time my enemy character has fallen underground (plane with collision) for some reason.

1 Like

Hi smbv1,

I’ve also tried making my navmesh dynamic (As I assumed it would force a rebuild of the navmesh on the opening of the level), however I had no such luck. A temporary solution that I came up with was to create an actor in C++ to place into the world that grabbed the global NavigationSystem object and force a rebuild using the following code:
UNavigationSystem *NavSystem = UNavigationSystem::GetCurrent(GetWorld());
if (NavSystem != nullptr)
{
NavSystem->Build();
}

While this works, it does force the rebuild each time that the world opens, which increases load times a fair bit. I’m still fiddling around but my current train of thought is to store the data of the navmesh in the game instance (Not sure how much over-head I’d have keeping the built navmesh in memory so this may be a terrible idea.).

Thanks for looking into this.

I glad you have some solution, anyways I would definitely report about Nav-Mesh doesn’t build in Static mode, if it would, this way you probably won’t have any issues and you don’t have to work around, it just has to work when you build and package.
I also spawning entire level, with Dynamic nav-mesh it worked, I don’t use C++ for this, but your solution seems okay, I would not worry much about nav-mesh preloading time, usually, it is not that time-consuming.

I’m trying to build on the Quest and the navmesh is getting ignored (only android, pc builds work fine).
Unfortunately I’m using only blueprints - is there any equivalent way of what you did but for blueprints instead of c++? Or maybe some other setting that anyone knows about? Thank you