- Home /
Why Local Rotation Faster than World Rotation (Degrees/Second)
I am working with a player control that handles player rotation and camera rotation all in the same Update function. I rotate the camera in local euler rotations and rotate the player in the world euler rotation. However the camera rotates faster (degrees/s) that the player. Both the camera and the player use the same variable to rotate. The code I am using is here:
neck.transform.localEulerAngles = new Vector3(currentXRot, currentYRot, 0);
transform.eulerAngles = new Vector3(0, currentYRot, 0);
Any clues on why this is happening?
Answer by 0V3RR1D3 · May 23, 2015 at 07:35 AM
Is "neck" parented to the main gameObject, Becuase what I think is happening is that becuase the net is parented to the gameobject, When rotating the gameobject it will also rotate the neck with it, Seeming like you are running at double the speed. Other that that i dont know, You should post more code.
Right @0V3RR1D3 the neck is parented to the root player transform. I can subtract the rotation of the player from the rotation of the camera, and everything is fine. But I want the rotation of the parent to influence the rotation of the camera. $$anonymous$$eaning that I can walk upside down and have the same properties of the camera apply. $$anonymous$$eaning that the same thing would happen with the camera upside down as it would upside up.
Your answer
Follow this Question
Related Questions
GameObject Rotation is always postive 0 Answers
how to get the absolute direction? 1 Answer
Problem in Euler angles 2 Answers
My object isn't rotating to the transform of another object. How do I fix this? 1 Answer
Relative Rotation of GameObject 3 Answers