Tuesday, September 13, 2016

vector - Why rotating an object only on its local X axis result in sudden 180 degrees changes in Y and Z axis rotation values


I have an object (cube) in the scene and I want it to continuously rotate on its only local X axis but suddenly while rotating on X axis its Y and Z axis rotation value goes 180 degrees for some frames, but it looks fine in the game view. Please help me to get out of this problem. It is also noted that this problem doesn't occur while rotating only on Y or Z axis. Code:-


    void Update () {
transform.Rotate(new Vector3(1,0,0),
Space.Self);
}


enter image description here




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...