- Home /
How would I get my parents rotation?
I have a script, but the parent has a rotation I need. I saw a float thingy that can be like...
x = blah blah
I just cant find it, and help?
and if you need to know, the script Im making is a equip script, so I can clone the weapon into the player.
Answer by aldonaletto · Nov 24, 2013 at 12:59 AM
If you really want the parent rotation, read transform.parent.rotation - but notice that this is a Quaternion, whose XYZ components aren't angles! If you actually want the parent rotation about world X in degrees, read transform.parent.eulerAngles.x instead - but be aware that reading eulerAngles isn't so reliable: there are several XYZ combinations that correspond to the current rotation, and Unity may (and often will) return the "wrong" one. This is particularly true when the other axes are non-zero, or when the angle about any of them crosses a multiple of 90 degrees.
This post took like 5 hours to get approved, I figured out how to do it. anyways sorry for wasting your time.
Please don't post comments as answers. Post comments by clicking the [add new comment] button, a window then open for you to type in. Answer fields are for answers only, as this is a knowledge base.
Here at Unity Answers, Answer means Solution, not Response.
Read this page : http://answers.unity3d.com/page/newuser.html
Please watch : http://video.unity3d.com/video/7720450/tutorials-using-unity-answers
have converted this one for you.*
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Instantiating a random dropped consumable item from many cloned objects 1 Answer
Getting a copy/clone of an object from an array (C#) 1 Answer
How to import the object from server to unity 2 Answers
Code only affects first clone? 2 Answers