- Home /
How to get rotation relative to the ground normal?
I am trying to make an anti-gravity kart game demo, but I need to find a way to limit rotation according to ground normal. This is because I still want to use rotational dynamics such as torque, so I want to avoid setting the rotation through the script. I already got the kart following the floor's rotation since I am using the relative constant force component.
What I want to do is limit the rotations on the x and z axes to a 45 degrees max. Here is a diagram to help visualize this. I show the z-axis, but I would like the same with the x-axis. How can I accomplish this? I know raycasts will be involved to identify the road normal, but I am confused with the rotations.
untitled-drawing.png
(30.5 kB)
untitled-drawing-1.png
(23.9 kB)
Comment