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.
In the next chapter, we will look at how to extend the idea behind the A* algorithm as we look at navigation meshes.