- Home /
How can i make my cube not be a 3D parallelogram when i rotate it under its parent?
I have a 2 cube game objects. one game object is 3 times longer than the 1st one. The longer one is the parent of the sorter one. I added a script to rotate the smaller one, but the shorter object turns into a parallelogram when i run the game.
the code:
function Update () {
transform.Rotate(Vector3.right,-90*Time.deltaTime);
}
Comment
Best Answer
Answer by emc233 · May 30, 2013 at 10:45 PM
use child.transform.localRotation
you can alternatively use transform.RotateAround()
Your answer
Follow this Question
Related Questions
script to use the enter key to switch to the next scene 0 Answers
Changing Color Based on Z position 2 Answers
Temporary Rotation 2 Answers
i need some code suggestions 1 Answer
How can I teleport objects. 4 Answers