Next up, we'll be implementing the A* algorithm in a Unity environment using C#. The A* Pathfinding algorithm is widely used in games and interactive applications even though there are other algorithms, such as Dijkstra's algorithm, because of its simplicity and effectiveness. We've briefly covered this algorithm previously in Chapter 1, *The Basics of AI in Games*, but let's review the algorithm again from an implementation perspective.

Let's review the A* algorithm again before we proceed to implement it in the next section. First, we'll need to represent the map in a traversable data structure. While many structures are possible, for this example, we will use a 2D grid array. We'll implement the `GridManager ...`

Start Free Trial

No credit card required