As our tank uses a NavMeshAgent
component to traverse the environment, we need to set up our scene using static game objects for the bake process to work properly, as we learned in Chapter 4, Finding Your Way. The maze is set up in a way so that towers are spread out fairly reasonably and that the tank has plenty of space to maneuver around easily. The following screenshot shows the general layout of the maze:
As you can see, there are seven towers spread out through the maze and a few twists and turn for our tank to break line of sight. In order to avoid having our tank graze the walls, we adjust the settings in the navigation window to our liking. By default, the example scene has the agent radius set to 1.46 and the step height to 1.6. There are no hard rules for how we arrived at these numbers; it is just trial and error.
After baking the NavMesh, we'll end up with something similar to what's shown in the following screenshot...