- Home /
Rotate an object AND it's axis
Is there a way to rotate, say a cube, around a global axis, and have its local axes also rotate around that global axis?
I need this because I am trying to get a cube to rotate around its x- axis, but if I turn the cube right or left, the x-axis does not change so the rotation is no longer 'forward'.
Thanks
Answer by kilgore · Aug 25, 2013 at 01:06 PM
Use transform.localRotation along with transform.rotation. Global rotation will always rotate your object according to the world coordinates. Local rotation uses the axis of the gameObjects transform.
I'm sorry I don't think I understand exactly what your trying to do. Can you give us a very specific example of the kind of rotation your are looking for?
Your answer
![](https://koobas.hobune.stream/wayback/20220613112930im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Is it possible to keep an object upright inside another game object that is spinning or rolling 1 Answer
X position relative to..... world? 1 Answer
Creating an axes representation on the screen? 0 Answers
Rotating Player Controller locally or globally. 0 Answers
Problem with transform.Rotate 1 Answer