NavMesh Baking
Tutorial
·
Beginner
·
+10XP
·
25 mins
·
(289)
Unity Technologies

NavMesh Components make up the navigation system in Unity. The navigation system allows users to create characters that can intelligently move around the game world, using navigation meshes that are created automatically from your Scene geometry. Dynamic obstacles allow users to alter the navigation of the characters at runtime, while off-mesh links build specific actions like opening doors or jumping down from a ledge.
Languages available:
1. NavMesh Baking
This tutorial has been verified using Unity 2019 LTS
NavMesh Components make up the navigation system in Unity. The navigation system allows users to create characters that can intelligently move around the game world, using navigation meshes that are created automatically from your Scene geometry. Dynamic obstacles allow users to alter the navigation of the characters at runtime, while off-mesh links build specific actions like opening doors or jumping down from a ledge.
2. Baking the NavMesh
The process of creating a NavMesh from the level geometry is called NavMesh Baking. The process collects the Render Meshes and Terrains of all Game Objects which are marked as Navigation Static, and then processes them to create a navigation mesh that approximates the walkable surfaces of the level.
1. Select scene geometry that should affect the navigation: walkable surfaces and obstacles (Figure 01).

Figure 01: Selected Walkable Surfaces and Obstacles
2. Check Navigation Static on to include selected objects in the NavMesh baking process. (Figure 02).

Figure 02: Selected objects are set to Navigation Static and Navigation Area is set to Walkable
3. Adjust the bake settings to match your agent size (Figure 03).

Figure 03: Bake Settings
- Agent Radius defines how close the agent center can get to a wall or a ledge.
- Agent Height defines how low the spaces are that the agent can reach.
- Max Slope defines how steep the ramps are that the agent walks up.
- Step Height defines how high obstructions are that the agent can step on.
4. Select Bake to build the NavMesh (Figure 04).

Figure 04: Baked NavMesh
3. Conclusion
At this point, the NavMesh has been created, but a NavMesh Agent must be configured to create the pathfinding functionality. Check out Working with NavMesh Agents to learn how to configure NavMesh Agents.