Make a race opponent?

I’m making a simple race game with a track that has 2 straight lines and 2 180 degree curves. I’m using the car scripts from Ian Scott. I want to make an opponent that is rigid body. Not that it’s racing with an animation but that it understands when to brake steer and dodge my car.

Does anyone know how to?

Sorry it’s not SOLVED. I didn’t mean to do that.

i guess you should know the speed max that a car can make in that curve.
then you have to know the deceleration given by the brakes. (meters/second)
know the current speed of car , and the distance from the curve.
calculate if is time to press the brakes or you can again press on gas.

max_speed_of_curve
distance_from_curve
current_speed
deceleration(brakes)