O'Reilly logo

Unity 5.x 2D Game Development Blueprints by Abdelrahman Saher, Francesco Sapio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

AStar Algorithm in Unity

The AStar Algorithm is famous for being one of the most reliable pathfinding algorithms out there. It is mainly used to find a proper traversable path between two points, as shown in the preceding figure.

We won't be diving into the specifics of the AStar Algorithm, but we will use it in our game to plan the paths of AI characters.

A tool for Unity

Luckily, a great tool to make the process of implementing AStar in Unity already exists, and it is also freely available. It can be downloaded here: http://arongranberg.com/astar/download. I suggest downloading the latest stable release and avoid any beta version for any bugs that it may have, as shown in the following image:

After extracting the downloaded archive, double-click ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required