Traffic system

Hello everyone
I have an AI car and traffic light contains red, green and yellow sign and I want to connect the car with the traffic light whenever it turns red the car should stop,
and when it turns green the car should move
any idea how to do that
thank you

You could make a collision box, and when the car enters, it checks the state of the light. As for the rest of the cars behind, they can check if another car is in front of it(using line trace maybe?) and stop.