I am in the process of updating the codes to the latest Unity version and rewrite the tutorials. You can find the previous version of tutorial codes in the branch 2023
In this tutorial, we will implement a generic pathfinder in Unity using C#. We will approach the tutorial from a basic 2D grid-based pathfinding to a more robust generic pathfinder that we can use for a graph-based data structure. We will then apply our pathfinder to a variety of pathfinding problems.
In this first tutorial, we create a generic pathfinder that is algorithm agnostic. Then we create three implementations of the pathfinder using the A*, Djikstra and Greedy best-first algorithm. We apply this generic pathfinder to various pathfinding problems (8-Puzzle, rectangular grid-based map and graph-based map).
In the second tutorial, we apply our generic pathfinder and solve the 8-puzzle problem and demonstrate the application in Unity.
In the third tutorial, we apply our generic pathfinder and solve the 2D grid-based pathfinding and demonstrate the application in Unity.
In the fourth tutorial, we apply our generic pathfinder and solve the graph-based pathfinding problem and demonstrate the application in Unity.