Cant get a car to stop going forwards while in mid air

In a racing game I have designed, I have parts of my game that includes ramps going up, as well as ramps going down. Whenever you are at the top of the ramp and continue pressing the forwards button (w), the car turns into a rocket. To fix this, I have tried to make it so that the car can’t move when it is in mid-air. My portion of the project is scene one. you can look through my code with the link provided if it works.
Thanks
Tarren

I do not see a link in your message. So below how i would approach a moving and sometimes airborn car:
I would assume that your car as (at least) two variables associated with it:
say car_speed and car_friction (which might depend on the planet and surface the car is currently on).
Then there is a loop that independently keeps moving the car forward with amount car_speed, and which decreases car_speed by car_friction.
When you press the forward-button and the car’s wheels touch a ramp or the ground/road you add some constant to car_speed.
Good luck!

2 Likes