Hello, is there a way to limit Quaternion rotation, without using eulerAngles? Lets say I’d want to limit Transform’s rotation on Y axis (in 3d space) and between -90 and 90 degrees.
My implementation looks like this, but it works not good. Suffers from gimbal locking.
Hi, a new issue arise. When the angle is being min clamped, final rotation stays solid, until target moves to max clamp, where the rotation sometimes just ignores clamps and rotates to the other clamp through rotation which it should not achieve. My implementation look like this:
I made a gif visualising the issue. Red block represents X axis, Green Y axis and Blue Z axis.
Clamp is set to -100, 100.
grizzledunhappyghostshrimp
Is there a way to prohibit this weird behaviour?
Instead Lerp the Angle itself… so if angle is clamped at -100 and you keep going around and suddenly angle is 100, you would slide -100 smoothly down to 100 and use that value to continue to produce rotations.