How To Spawn NavMesh in procedural Level

I’ve made procedural level but don’t know how to spawn nav mesh inside it

Hey Mateusz88,

This is a question that has actually been answered over on this thread: How to build navmesh for dynamically sized procedural level - World Creation - Unreal Engine Forums

Head over there and you should be able to find some information that will help you get a good starting point!

Have a great day

1 Like

Thanks for response but still don’t know how to do this only in blueprint

I’d recommend as Mieszko stated in the linked thread to just create a Nav Mesh Bounds Volume that scales the entire span of what you’d expect your level to be at maximum. That way you’ll ensure that the Nav Mesh will generate on geometry that you spawn. Just ensure to set the runtime generation to dynamic on the Nav Mesh

This could work but I don’t know how big level will be because it will be created on the fly and will probably be endless. So I need to spawn nav mesh in blueprint

Concept is in link below

What you’ll need to do is initially place the Nav Mesh and then scale it using the method described in the post I linked. Here’s the exact quote:

“I exposed the UNavigationSystem::OnNavigationBoundsUpdated function to Blueprints, and called SetActorScale3D on the NavMeshBoundsVolume in my level generation blueprint, and then called the OnNavigationBoundsUpdated node afterwards.”

That should allow you to scale the Nav Mesh dynamically and ensure that it encompasses your entire level as it’s generated.

You’ll also need to keep in mind that you will need to degenerate parts of the level as you don’t need them anymore or else the performance will be awful. Especially if you’re generating a Nav Mesh for the entire thing.

hello, i have a lvl generated indefinitely and i try to move or scale my navmeshbounds I was told that there was no need to expose the function anymore, but i got an error when i try to reference my navmeshbounds with SetActorScale3D… someone has an example of using the ‘OnNavigationBoundsUpdated’ node? or a way to attach my navmesh bounds to my player?