Setting up Navmesh in Unity

Tyler Smallwood
3 min readJun 14, 2023

Objective: Set up Unit’s Navmesh.

In Unity, we have a navigation system created by Unity. We can have AI’s use this to move around in the scene. The AI’s will need to use two things. One is the Navmesh that will be on walkable area’s and the other is a Navmesh Agent that will know what it can walk on. To start we will start by adding the Navmesh to the walkable area’s. In my scene I got a small run way set up with waypoints, to be used later.

Next we will go to Window → AI → Navigation.

A window will appear in the same area as the inspector.

With the Floor selected we will set to static and make sure it is set as walkable.

Once you set the floors to walkable, we need to Bake the Navmesh onto the ground. Go to the Bake tap and select Bake. You can play the settings to adjust the agents height and more. Depending on the Radius may affect climbing stares.

Once that is done we can see our floor now has blue on it.

If you don’t make sure Gizmos are turned on.

More information can be found here.

Next is to set up the AI to use the Navmesh. Create a AI, I just used a sphere, and add Navmesh Agent onto it.

If you look at your AI, you should see a cylinder collider around it. That will portray your AI. You can adjust it by adjusting the settings on the NavMeshAgent. Base Offset will raise or lower your AI, can control how it moves around, and avoid obstacles.

This is how to get started with NavMesh, Thank you for reading and have a wonderful day!

--

--

Tyler Smallwood

I am passonate on learning to program and use Unity to become a skillful Unity Developer