Summary

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 ...

Get Unity Artificial Intelligence Programming - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.