A* Pathfinding in Unity

Code Monkey · 407K views · 2019 · 24:39

Open on YouTube

Game programming & enginesAlgorithms & data structurestutorial

Why Stack Overflow recommends it

Stack Overflow users link it as a worked A* implementation in Unity, both as a base to adapt to their own grids and as a starting point for people asking how to do pathfinding.

Recommended by 1 people across 1 different months, 2020 to 2021.

What it is

A 25-minute Unity tutorial by Code Monkey that builds A* pathfinding in C# on top of the channel's earlier grid system, with on-screen visualization of the open and closed nodes as the algorithm runs. It walks through node costs, heuristics and path retrieval step by step.

What people said

Recommends AnthemGames · 2021-01 · Stack Overflow · on “A* Pathfinding on Multiple Grids?”

if you want you learn more about the heuristics, here's the video where i took the pathfinding code [this video] the only difference that i made is that i just added a 3D array and made it work with my own grid edit: oh yeah, i also got rid of the diagonal Movement

Cites TheWhiteRice2006 · 2020-02 · Stack Overflow · on “Issues with A* implementation, without a grid, in Unity 3D, in c#”

I am making a river generator, and I am using a* pathfinding to make it. Earlier I made one and had a few issues, Custom made a* Path finding isn't working very well [LINK] . I remade it according to this tutorial [this video] except I didn't use a grid, and used something else. I am sure that this is the cause of my issues, but I don't know the solution. The issue is that there is no path when I use this. The code using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Linq; public class APath { private int StraightCost = 10; private int DiagonalStraigtCost = 14; public APathNode[,] all; public bool[,] pathDraw; public List<APathNode> open; priva

Cites Rafit _ · 2021-07 · Stack Overflow · on “Unity Pathfinding”

[this video] You should look for A* pathfinding. And to make phases, try making first one phase and once you figure out how to implement that, create the other ones. Focus on one thing at a time.