Pathfinding with Roads


First of all I am going to show you an image of what I have in the moment

What happens is great, but only in this case, because the truck should ever be using the right lane, and not the shortest path.

I’m going to explain it with the following image

Has anybody of you done something like this before?
It is like beeing able to give Aron Granberg’s Unity3D A* implementation a restriction to just calculate certain routes.

Or maybe someone can think of a solution that uses another pathfinding algorithm like the simple node and edgebased Dijkstra algorithm? Or a combination of both?


You could eihter use different graphs for each lane direction, and have the truck change which one to use depending on which land it is on, or you yould experiment with the penalty & tag features of the Astar Pathfinding Project, OR you could use GraphUpdateObjects to set teh lane the truck is NOT one at the moment to unwalkable, and update this whenever it switches lanes :slight_smile:

Hey my friend… Have you found any solution on this? Today I’m stuck in the same problem.