<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" /> Navigation
</aside>
Shaders, Effects, Optimization
To make a game object walkable it has to meet the following requirements:
Have Mesh Renderer and Mesh Filter components
The model should have enabled Read/Write in the Import Settings
Has its layer set to Ground or Water.
There are three types of navigable surfaces:
By default every navmesh surface is walkable. To change the type of the surface add a NavMeshModifier component to the game object, click on the Override Area checkbox, and select the desired Area Type
The Shore area allows to simulate walking in the shallow water. Note that if there is no Shore area nearby the Player will not walk on water at all and will swim even just next to the ground.
If the Player encounters the edge of the walkable area and there is another walkable area directly in front and below them, the Player will jump. To configure the necessary high difference for the Player to jump, go to the Assets/Project Files/Game/Prefabs/Player/Player.prefab
, and adjust the “Jump Height Difference” field in the PlayerBehavior script of the root GameObject
To create an obstacle, simply add a Nav Mesh Obstacle Component to the GameObject and configure its parameters such as type, position, and size. Consider selecting the Carve checkbox for better quality collision avoidance for the player and helpers.
Any Nav Mesh Agent has to have “Walkable” and “Shore” area masks selected, and can also have selected “Water” area if they have the ability to swim.