Navigation Mesh in Unreal Engine 4 allows us to tell the engine where our traversable path should be generated, and we can optimize this to help generate more accurate paths for our AI. We will call Navigation Mesh "NavMesh" for short as most game developers are familiar with this term. If you're in Unreal Engine and you navigate to the Modes panel under Volumes, you'll see NavMeshBoundsVolume. This is a volume that you can use to cover the geometry and generate NavMesh on. I have a sample of what this would look like. If you can't see the green mesh generated by NavMesh, make sure you check the Navigation option (press P for shortcut) in the Show menu onscreen:
On each level, you'll see a node within World Outliner called RecastNavMesh-Default. If you click on it, you can explore the default options that affect Navigation Mesh within the level.
If you go down to Generation, this is what you will begin to tweak according to your needs. If you're trying to get more performance when rebuilding at runtime, or precision with your agent's movement, try to optimize these values:
I will briefly go over some of the properties to give you an understanding of what role they play and how they affect performance. Let's look at some of the most important properties in RecastNavMesh:
If you have any obstacles in your NavMesh and NavMesh is being generated on top the obstacles, then this object is treated as geometry, and for better performance, you can make your mesh be recognized as a Dynamic Obstacle. This prevents NavMesh from being generated on top of it. Now, to affect this area, you must set the Offset and Extent values for the Box Collision property as well. Take a look at the following screenshot:
In this NavMesh, for example, I've set the properties accordingly; take a look:
As you can see in-game in the following screenshot, the correct location is affected by the NavArea Null
class we set on the Is Dynamic Obstacle option: