- Home /
How to find a rotation of a child object
So I have an object called 'hinge' with a rotation of (0, 0, 0) and a child object of hinge called 'door' with a rotation of (0, 45, 0). There is a script attached to this door and the hinge becomes a parent of door on runtime. Now if I have this piece of code
print (transform.rotation.y);
it gives me a value, but when I put this code
EndRot2 = Quaternion.Euler (0, transform.rotation.y, 0);
print (EndRot2.y);
it gives me another value, how is this possible and how can I make it so that Endrot2 stores a rotation that is (0, 45, 0)
Thank you!
btw the values are respectively 0.3826835 and 0.003339537
and 0.38 is not the radian value of 45 deg so what is it?
UPDATE: So I found out that 0.382 gets calculated when converting the eulerangle to a quaternion
Your answer
Follow this Question
Related Questions
Get slerp to work just as LookAt(,Vector3.right) does 1 Answer
Boids for 2D 0 Answers
Instantiated Objects Point towards unknown point 0 Answers
How to use quaternion.lerp 2 Answers
Rotate object without storing facing 1 Answer