- Home /
use world axis when using transform.rotate
Hello, all. I was wondering if there was a way for me to achive a transform.rotate function using the global/world axis, not the local. All help is appreciated.
Comment
Best Answer
Answer by Muzz5 · May 21, 2011 at 11:27 AM
Yes, just add Space.World at the end (before the closing parenthesis and semicolon.)
$$anonymous$$inor detail, but it'd actually be Space.World.
Who said World.Space? And what's that suspicious looking edited thing?
Answer by Peter G · May 21, 2011 at 12:25 PM
There is another argument that you can pass to Transform.Rotate that determines which space to use for rotating:
transform.Rotate( x , y , z , Space.World); //By default it is Space.Self and you do not need to include that value
or:
transform.Rotate( eulerAngles , Space.World); //Default = Space.Self.
This is what Muzz5 said, but I wanted to add an example.