Unity Artificial Intelligence Programming - Fourth Edition
by Dr. Davide Aversa, Aung Sithu Kyaw, Clifford Peters
Summary
In this chapter, we learned how to implement the A* pathfinding algorithm in Unity3D. We implemented our own A* pathfinding class, as well as our grid class, priority queue class, and node class. We learned about the IComparable interface and how to override the CompareTo method to implement our custom ordering policy. We used debug draw functionalities to visualize the grid and path information.
In later chapters, we will see that with Unity3D's NavMesh and NavAgent features, it may not be necessary for you to implement a custom pathfinding algorithm on your own. Nonetheless, having an understanding of a basic pathfinding algorithm gives you a better foundation for getting to grips with many other advanced pathfinding techniques. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access