Hi,
I use a FirstPersonCharacter’s in my game, and I’d like to block its total rotation. From top to down, it’s due to the ClampRotationAroundXAxis method in Mouselook script.
But there is no indication to limit the rotation also on the Y axis.
I’ve tried the code below in the ClampRotationAroundXAxis method but it didn’t work
float angleY = 2.0f * Mathf.Rad2Deg * Mathf.Atan (q.y);
angleY = Mathf.Clamp (angleY, MinimumY, MaximumY);
q.y = Mathf.Tan (0.5f * Mathf.Deg2Rad * angleY);
Have you a solution?
Thanks