How to get angle between player forward vector and cursor location?

I’ve tried this:


and it’s not what i’m want:

so if u know, please help

site’s not letting me send 2 screenshots, so here’s the second

I’m not sure what’s happening at the end of your blueprint code but it definetly feels wrong because you’re comparing a rotation value to a vector value. Why don’t you try this instead? Subtract the cursor location from the character location and normalize the result by using a “Normalize” node, and then calculate the angle between that and the forward vector by using the “Dot Product” & “Atan (deg)” nodes. Atan function wouldn’t give a negative result so you would also need to invert the final result if the z component (or y, idk the orientation of your project but I mean the vertical axis) of the normalized vector is pointing at the negative direction or if it’s y component (meaning the horizontal axis) is pointing at the negative direction.

Alternatively, you could simply compare the angle between the character and the cursor by using the “Find Look at Rotation” node and subtract a value (which is equal to the difference between the 0 degree compared to the character’s forward vector and the rotation that is considered to point at 0 degrees globally) from the result. For example, if the find look at rotation node returns 0 degrees when your cursor is aligned witn the character’s forward vector, you wouldn’t need to adjust the result anyway. And to prevent the final result from being anything over 90 degrees or below -90 degrees, you can just subtract the final result from 360 when the character’s forward vector is pointing at the opposite direction.

Hope this helps! :blush:

Thank u a lot. I’ll try this tomorrow, hope this’ll work

you want the mouse world position not screen position, then you can just delta the rotators and get the Y value

I may be wrong but I’d think you could call “find look at rotattion” to get the two rotations, then subtract one from the other for the difference. Not sure if that’s what your looking for