Question by
vegaa055_unity · May 21 at 06:59 AM ·
3daipathfindingtraffic
How to keep vehicles in correct lanes
I have a simple traffic system using an A* pathfinding algorithm. I just have a simple 2-lane road and the cars are able to navigate, using the road, and stop at an intersection. Using a queue at the intersection I was able to implement a simple right of way. However, I am stuck on how I can keep vehicles on the right side of the road. I created a grid script that breaks the world up into nodes with a coordinate system. The roads are 2-nodes wide so I was thinking of how I could use that to my advantage but at the moment I hit a mental block. My question is what are some simple-ish solutions to keeping the traffic on its appropriate lane?
Comment