How do I get my Navigation Mesh to recognize an instanced static mesh?

I have a procedurally generated maze that is done inside of an instance manager BP. It essentially loops through my parameters and adds instanced static meshes based on a random path. To create the maze I followed this YouTube tutorial: UE4 | UE5 | Maze Generation Tutorial - Pt 1 - YouTube

I have an AI and the Player spawn at a random point in the maze, and I’m trying to get the AI to come track the player down via AIMoveTo.

The problem I’m running into (how I understand it), is that the Navigation Mesh Volume has already been built before the maze spawns in. So once the maze spawns, it doesn’t try to build the NavMesh again. It’d make sense that setting Nav to Dynamic would fix this but it does not.

I am spawning the maze into the world by first spawning in the Instance Manager actor BP, and then the Maze actor BP. I’m doing this in the Level BP.

However, if I manually place the Instance Manager and the Maze BP into the Level, then go into the Static Mesh file for a piece of the maze’s floor and change the material, the pathing will update inside the maze. I’m able to add in an AI and a Player Start and the AI will follow me around like it should. If I manually move the maze after this, the pathing resets and I have to change material again to get it back.



Is there a way to force a rebuild of the NavMesh after the maze is loaded? Am I approaching this from the wrong angle? I can post more screenshots or post any extra info.

Thank you for your help!

I kind of solved this - I just stopped using instanced static meshes. Made all of the meshes I was using into Actors and spawned those instead without the use of an instance manager.

A little heavier on the FPS but after scouring for answers for hours I feel like I had no choice.

I experienced a similar problem with UE5.0.X.
Dynamic NavMesh was not properly created for procedurally generated ISM instances.
In my case, I solved it by setting the ISM’s collision to “No Collision” after procedural generation, then resetting it back to “Collision Enabled”.
This only needs to be done once after the actor containing the ISM is spawned.
After that, the dynamic navmesh will update normally.
Hope this helps someone who will experience a similar problem in the future.

I tested this in UE5.1.1, I don’t know if this works for UE5.0.

You need c++ to get this problem fixed:

in .h file:

UFUNCTION(BlueprintCallable, Category = "GameHelpers")
	static UInstancedStaticMeshComponent* AddInstancedStaticMeshes(AActor* Parent, UStaticMesh* Mesh, const TArray<FTransform>& Transforms);

in .cpp file:

UInstancedStaticMeshComponent* UGameHelpers::AddInstancedStaticMeshes(AActor* Parent, UStaticMesh* Mesh,
	const TArray<FTransform>& Transforms)
{
	if(Parent)
	{
		UInstancedStaticMeshComponent* InstMeshComp = NewObject<UInstancedStaticMeshComponent>(Parent);
		if(InstMeshComp)
		{
			InstMeshComp->SetupAttachment(Parent->GetRootComponent());
			InstMeshComp->RegisterComponent();
			InstMeshComp->SetStaticMesh(Mesh);
			InstMeshComp->AddInstances(Transforms, false);
			InstMeshComp->SetCollisionProfileName("BlockAll");
			InstMeshComp->SetCustomNavigableGeometry(EHasCustomNavigableGeometry::EvenIfNotCollidable);
			
			return InstMeshComp;
		}
	}
	return nullptr;
}

None of those fixes worked for me, and I’m not familiar with C++ whatsoever.
HOWEVER I did some digging into the modifying the navigation mesh documentation, and found that there is a setting in Project settings labeled “Runtime Generation” that when set to dynamic, it fixes the issue,