I want to get the angle between the rotation (euler Angles) of the camera (V1 : Vector3
) and the collision point of my character, when it hits a wall, to determin, if it was left, right, or in front of it.
I tried to use Vector2.Angle
with V1 and V2 (ControllerColliderHit.moveDirection
as a Vector2
) to get the difference between them.
However I get a different value (0, 90, 180) when running into the wall depending on the world direction. (left wall, right wall, etc.)
How can I get the angle of the collision point relative to the direction the camera is facing?