- Home /
Question by
douglasg14b · May 03, 2015 at 06:21 PM ·
anglesvectors
How to find the angle between two vectors?
I've seen a few other questions with the same title, but they seem to be trying to find an angle from two points. This diagram describes what I want:
Suggestions?
Comment
Best Answer
Answer by $$anonymous$$ · May 03, 2015 at 06:37 PM
Hey, you can use Dot Product or some trigonometry:
// Get Angle in Radians
float AngleRad = Mathf.Atan2(Vect1.y - Vect2.y, Vect1.x - Vect2.x);
// Get Angle in Degrees
float AngleDeg = (180 / Mathf.PI) * AngleRad;
Another post, might help you as well:
untitled.png
(11.3 kB)
Thanks for the answer! I just found out that Vector3.Angle() will give you the actual angle if the unity vectors are normalized.
Answer by dbdenny · Jun 23, 2020 at 06:16 AM
Vector3.Angle(Vector3 from, Vector3 to);
Reference here: Manual of Vector3.Angle
Your answer
![](https://koobas.hobune.stream/wayback/20220613194652im_/https://answers.unity.com/themes/thub/images/avi.jpg)