In this chapter, we learned how to generate and use navigation meshes to represent the scene for pathfinding purposes. We studied how to set up different navigation layers with different costs for pathfinding. We used the Nav Mesh Agent component to find the path and move toward the target using the destination property. We set up Off Mesh Links to connect the gaps between the navigation meshes using both the autogeneration feature and a manual setup with the Off Mesh Link component.
With all this information, we can now easily create simple games with a fairly complicated AI. For example, you can try to set the destination property of AI tanks to the player's tank's position and make them follow it. Using simple FSMs, they can start attacking the player once they reach a certain distance. However, FSMs have taken us far, but they have their limits. In the next...