mouse angle

hey, im stuck by this problem quite a while now.
I expect angles from 0 to 90 degrees, but i get something like 0 to 57 degrees.
I can`t find a solution for my problem :frowning:

Vector3 mousePos = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0.0f);

float angle = Vector3.Dot(mousePos.normalized, new Vector3(1.0f, 0.0f, 0.0f).normalized) * Mathf.Rad2Deg;

Vector.Dot with normalized vectors will give you values between -1 and 1. But that is not the angle. It is the cosine of the angle:

So you need the inverse of Cos to get the actual angle:

And we got it. But you can also use Vector3.Angle (…).

Hey, thanks.

i feel a bit stupid now, because i had this not in mind, but thx for the fast and usefull reply :wink: