1. Create a new scene.
  2. Drag the nav_test object from Samples/Level Meshes into the scene.

                                                   

  3. Select the nav_test game object and add a new tag in the inspector. Call it Navigation Mesh.
  4. Set the tag on the nav_test game object to be Navigation Mesh.
  5. Click Window -> Recast -> Generate a Nav Mesh.
  6. Select the Navigation Mesh tag from the list of tags
  7. Scroll down to the bottom of the window and hit build.

Before we move on, lets take a look at what we now have in the scene. First there is the nav_test game object which is a test level with both slopes and stairs.

You should now have a RecastNavMesh game object that has a Mesh for a child. If you click on the RecastNavMesh you can add a material to it and toggle the geometry on and off to see the NavMesh after it is built. A shader and material has been provided in Samples/Level Meshes/Materials called vertexMat which will color the NavMesh a semi-transparent blue.

By modifying the values for the Agent, we can limit the areas the player can walk. If you increase the Max Climb to 1.6 and build the NavMesh again, you will notice that the stairs are now walkable by the agent. If you decrease the max slope to 10 the hills will become unwalkable as the slope exceeds 10 degrees.

The RecastNavMesh is also where you can export the NavMesh in XML, JSON, or Binary JSON. That file can then be used later on a server or in your own unity game using the RecastNavMeshQuery which we will cover later.