Working with Unity’s Nav Mesh System for Smart AI
Stealth Game & Cinematography
Lets take a look at more detail about the navigation system in unity to create a smart AI.
To make this happen you first need to open a navigation tab so go to Window>AI>Navigation.
Inside navigation, you are going to see four additional tabs Agents, Areas, Bake and Object.
Agents: It is used to setup our default navmesh agent settings which is used by the gameobject to navigate and move around the navmesh. Name is whatever you want it to be and by default it is Humanoid but you can change it to another if you wish to. Radius defines the width of the agent collider, height defines how tall the agent is, step height store the value for how high the agent can step up and Max slope defines the max angle agent can move up on.
Areas: This is similar to the tag of unity that defines a gameobject but in this case, it defines properties of the nav mesh. By default there are Walkable, Not-Walkable and Jump but you can add another 28 other custom tags that defines specific color in nav mesh.
Bake: It is like a play button of your game but here when you bake the nav mesh here, you can then use the nav mesh in your project.
Object: This is where you are going to define the property of your collider object. Here, you can select a collider gameobject in this case FloorCollider and you can define it to static and select the area as walkable. After you bake the scene, you can now use this FloorCollider gameobject as a floor for navigation.