Navmesh Agents — The Backbone of AI Pathfinding
Now that the floor is baked and readable by the AI, it is time to delve into the nuances of AI pathfinding in Unity.
The first thing the monster needed was a NavMesh Agent component.
The Navmesh Agent is Unity’s built in solution for reading the navigational data generated by baking the surfaces. With this component, the object “knows” where it can and cannot go.
It is worth noting that the NavMesh Agent does not give movement instructions to the object: that must still be done through code. It simply sets the boundaries of where the object is allowed to travel to!