Create a NavMesh
You need to create a NavMesh to define an area of your scene within which a character can navigate intelligently.
To create a NavMesh do the following:
- Select the scene geometry where you want to add the NavMesh.
- In the Inspector window, click Add Component.
- Select Navigation > NavMesh Surface.
- In the NavMesh Surface component, specify the necessary settings. For details on the available settings, refer to NavMesh Surface component.
- When you are finished, click Bake.
The NavMesh is generated and displayed in the scene as a blue overlay on the underlying scene geometry whenever the Navigation window is open and visible.
You can bake the NavMesh again to update it each time you make changes to either the scene geometry, the NavMesh modifiers, the properties of the NavMesh Surface component, or the settings of the selected agent type.
To permanently remove a NavMesh from your project, do one of the following:
- Click the Clear button in the NavMesh Surface inspector.
- Delete the NavMesh asset file in the Project window. If you choose to remove the NavMesh Surface component itself from the GameObject, the asset file is not deleted, even though the NavMesh is no longer present in the scene.