- Home /
Question by
$$anonymous$$ · Dec 24, 2018 at 12:32 PM ·
quaternionvector3.angle
Convert Quaternion to vector3 and help on Return Angle Between Two GameObject using Vector3.Angle
To Get Angle Between two GameObjects i want to use transform.rotation in Vector3.Angle How to convert quaternion to vector3 And Does Vector3.Angle is reliable way to get angle?
Comment
Could you perhaps draw a diagram of the angle you're trying to find?
Answer by BastianUrbach · Dec 24, 2018 at 05:09 PM
Vector3.Angle does something slightly different, it calculates the angle between two directions, for example:
Vector3.Angle(firstTransform.forward, secondTransform.forward);What you probably want is Quaternion.Angle, which calculates the angle between two rotations, for example:
Quaternion.Angle(firstTransform.rotation, secondTransform.rotation);
Your answer
Follow this Question
Related Questions
Question about angles. 1 Answer
spherical projection of points to plane, precision error? 0 Answers
Manual Quaternions 3 Answers
Child versus Parent rotations 3 Answers
3D nested Turret Prefab Rotation 1 Answer