Get the actual path in nodes


When an agent goes to a destination, but for any reason he can’t reach that destination. There is going to be a new destination and how many nodes that destination is. Where can I get this? Because after searching for a path, when I ask for the destination, it remains the original, even though it’s not reachable.


You could get remaining path using ai.GetRemainingPath. See IAstarAI - A* Pathfinding Project


The remaining path actually displays the original amount of steps it would take. If it can’t reach the original node, because of an obstacle, it still displays the original amount. And for the next calculation, that amount get’s added. If originally it would take 3 steps, but it can only take 1 step. It would display 3 steps, and add the remaining 2 steps to the next move.