Now we need to set it up so that the car slows down when leaving the track
this is done by adding two new functions to the drive script which detect when the players collider has left or entered the track (trigger).
Add the following functions to your drive script..
void OnTriggerExit2D(Collider2D exit2D)
Speed = Speed / 2;
maxSpeed = 1.5f;
void OnTriggerEnter2D(Collider2D enter2D)
maxSpeed = topSpeed;