Cars often roll over

Godot Version

Godot 4.2.x

Question

Is there any solution to prevent my car from overturning?

3 solutions:
Make gravity or object heavier.
or
Clamp the rotation
or
Make so if it reaches a steep angle, you apply enormous amount of velocity to pull it back down.

Hope this solves something ;D

1 Like

How can i clamp the rotation ?

β€˜var rotation = clamp(rotation, min, max)’
Instead of min and max, put the min and max rotation you want. This should work, but note that rotation needs to be in radians, so you will have to do some calculations.