Trafic management / 2D / behavior

Hello,

I’m starting a new game. Trafic management will be the key topic. I’ve been trying some 2D Pathfinding plugin from the store but I can’t deliver what I have in mind.

It’s quite very simple : 2 cars are driving to the same target. when the first one reach its target or just stop, I need the car behind to slow down and wait for the car in front to start and move. Raycast can help me to slow down and stop the car behind but then, I’m rewriting the agent. is there something that could help to build a trafic management system with full control on the cars ?

thank you.

Hervé

Hi

To handle things like slowing down to not crash in to a car in front of it I would recommend to solve that using for example raycasts as you have noted. Pathfinding should be used for the overall path and then local modifications (such as slowing down) should be handled by the movement script.