TUTORIAL
- How to setup Navigation Mesh and Character Movement Component to run over hills
-
Set max step height of CharacterMovement component to the height of the object you want character to step over. For example: If you want character to step over box that is 96cm, then set max step height to 100cm.
-
Set the character’s Walkable Floor Angle to 90.
-
Now go to project settings —> navigation mesh
Note: Do not use RecastNavMesh-Default to change these settings. It gives unpredictable results.
Note the following values. As a test, I wanted my character to step up on a box that is 240cm tall. So I set the navigation agent max step height to 245 (added an extra 5), then on my character blue print, I set it’s max step height to the same value of 240cm.
The settings below also allowed my character AI to automatically walk over steep hills.
- Cell size = precision, the lower the more precise I believe.
- Cell height = the distance of navmesh from mesh.
- Agent radius = radius of smallest character in your scene
- Agent height = ??? anyone know? The height of characters can vary.
- Agent max height = ??max height of the biggest character in your game?
- Agent max slope = how steep character walks up something, i have mine set to 89 so it goes up anything.
Example: if you have a box that is 96cm high and you want your character to step up onto it, then set your characters max step height to 100cm. Then set the agent max step height to 100cm as well.