- Home /
Pathfinding with Roads
Hello
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?
Felix
Answer by Cherno · Aug 20, 2014 at 02:37 PM
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 :)
Thanks for the reply, unfurtunately there will not be only one car that can be controlled. And the way you described it, they would all have to drive in the same direction. Or every car has to have its own path, what i would like to avoid for performance reasons.
Answer by emergki · Oct 30, 2018 at 01:20 PM
Hey my friend... Have you found any solution on this? Today I'm stuck in the same problem.
Your answer
Follow this Question
Related Questions
Can i use A* pathfinding on planes? 1 Answer
A* pathfinding - how to put penalty below a character 0 Answers
Splitting scene into nodes for A* 0 Answers
How to calculate distance based on A*? 2 Answers
Move RigidBody with translate 1 Answer