Get Angle between actors?

Rotating a vector that is pointing in X-Direction in roll value won’t change the vector. Therefore you can choose any roll rotation that you want, it won’t tell you anything here. Yaw will tell you about left and right and pitch about up and down. For the pitch rotation, values bigger than 90 or smaller than -90 degree won’t make sense, since straight up is 90 degree and straight down is -90. Therefore e. g. 110 would be the same as -70.

The result of FindLookAtRotation won’t directly give any information about how the actors are to each other. For that you also need to take the current rotation of your actor into account. FindLookAtRotation gives you the rotation your actor would need to point to the other location, the difference between both rotators (LookAtRotation and rotation from actors forward vector) should give you the information about left/right (yaw of the rotator positive or negativ), up/down (pitch of the rotation positive or negativ), you would also need to check which is which.

1 Like