- Home /
please help to rotate a cube around it's own axis
I want to enter values of rotation first is thetax (rotation around cube's x axis) next is thetay (rotation around cube's y axis) , I give value of public variables thetax , thetay through inspector. there is also a default rotation. How to rotate according to given inputs . I have tried with Quaternions but they rotate around world axis,
Answer by blueshark- · Feb 08, 2019 at 08:47 PM
With Quaternions it's: transform.localRotation = myQuaternion;
With Vector it's: transform.Rotate((myVector), Space.Self);
or transform.Rotate(myVector.x, myVector.y, myVector.z, Space.Self);
..
Your answer
Follow this Question
Related Questions
Why is this rotation not performed as expected? 1 Answer
How to turn a character frame independently? 1 Answer
Why does the direction of the axis changes behaviour in Quaternion.AngleAxis? 0 Answers
How can I make it only rotate at X axis? 0 Answers
How would I interpret angular displacement from target rotation to max out at 180°? 3 Answers