- Home /
Question by
inglipX · Sep 22, 2013 at 11:54 PM ·
bugvector3smoothdamp
Vector3.Smoothdamp weird negative number glitch?!
Hello, when i try to smoothdamp to a negative X rotation the entire screen spins around weirdly and its all buggy, When i make tiltAmt a negative number it has this issue.
Vector3 tiltBackwardPos = new Vector3 (tiltAmt,0,0);
transform.localEulerAngles = Vector3.SmoothDamp(transform.localEulerAngles, tiltBackwardPos, ref velocity, tiltTime);
Comment
Answer by Bunny83 · Sep 23, 2013 at 12:08 AM
Read this page carefully.
eulerAngles are just a representation of a rotation in 3D. There are several ways to express the same rotation. The actual rotation is representated as quaternion to avoid a Gimbal lock
Answer by meat5000 · Sep 23, 2013 at 12:16 AM
localEulerAngles has an issue with anything over 360 degrees, which would include dropping below 0, I believe. The docs say Don't use it for incrementing.