In this guide we will enable open world navigation in Unreal Engine 4 using the Navigation Invoker system.
One annoyance that most developers forget to think about when creating open world or procedural levels is the navigation system taking hours to generate the nav mesh.
Using navigation invokers, we can generate the nav mesh during runtime without a long wait in the editor.
Before we Start
To enable these features, dynamic pathfinding must be enabled to allow the navigation mesh to generate during runtime.
To learn how to enable dynamic generation during runtime click here for our guide.
Only the areas of the level that possessed pawns are near will be generated.
To enable this setting we must firstly go to the project settings.
Once the project settings are open, click on the Navigation System tab.
Tick the checkbox named: Generate Navigation Only Around Navigation Invoker.
This tells the engine to only generate around actors that have the navigation invoker component.
To enable navigation generation on an actor, we first need to add the Navigation Invoker Component.
To add this to your actor, click the Add Component button in the top left of your blueprint editor and search for Navigation Invoker.
Once this component is added, setup the radius that the navigation mesh will be generated and removed.
From my testing, the default values work well for open world landscape levels.
When creating a procedurally generated indoor level, I recommend slightly higher values.
This prevents the actor from being trapped in their current room or area.
Demonstration and Example Files
Conclusion
That is all for enabling open world navigation in Unreal Engine 4!
Characters and pawns can now traverse large open or procedurally generated levels.
For further reading into the navigation functions in Unreal Engine, click here for the official documentation.
Hey just double checking, you still need a nav mesh volume for this to work right?
eitherway thanks for this, really helped me out 🙂
Yes you will still need a nav mesh volume around the area that you want your AI to move around.
I’m glad you found this guide helpful!
I tried this only works on two legged people have it set on my deer and it moves but very jurky like it does not know where to go any help fixing this or is this not meant for the 4 legged animals
This works with any type of character. I have used this AI in previous projects with wolves, bears and other 4 legged creatures. If you could explain what exactly is happening to your AI we can track down the issue and get it fixed.
some times a pain in the but just started new level put down nav mesh check only use nav mesh invokers add them to my deer and zombie put them both in the world NOTHING they just stand there
nav mesh invokers is broken in the new engine will not work like all of the videos on you tube where you put down the nav mesh and add invoker the add person to scene then poof wow it works NOT
just look at photo showing that it works only on unreal landscape does not work on third party open world map
Works perfectly in 4.27! Thank you very much for the great tip 🙂
Thanks for this, very useful.