Now add a sprite to the game with collision on. I have added a barrel. We can now get the car to decrease its speed on collision with this object. This will work if the playerhits any object including other cars.
Add a new function to your drive script which activates upon collision with another collider (not a trigger like the track)