Cars in City

I am trying to figure out how to accomplish this: AI cars driving around in the city. I figured I can have the AI cars behave as if they are on a race track. I have found this script here. If I were to do this, I would have to have AI cars in the right lane, and AI cars in the left lane at all times, they wouldn’t be able to make a u-turn, or switch lanes, etc.

So my main question(s) are: whats the best approach to have AI cars stop at a stop light? If I make the AI cars able to collide with my car (which I can drive freely), will the AI cars be able to continue driving after I hit them?

Are there any examples out there that do what I am looking for?

Thanks in advance

I would look into the A* script on the script wiki. Basically you set up waypoints that the cars would follow. You could set up proximity detection (via colliders and isTrigger) for stop lights to inform the car that it is near one, then see if it’s facing the light, and if the light is red, tell it to stop.

It’s up to you how you want them to behave on collision. You could inflict damage (or not) and have them still drive (or not) (or ‘badly’) When the damage adds up to ‘bad enough’ then they would just stop executing the ‘drive’ behavior (based on A*)