Look at mouse is not working as planned

Ooooh, it will be very long BP.
First, it obviosly on Event tick

  1. Calculating the actor’s position relative to the window


2)Calculating the mouse’s position relative to the window

3)Then I subtract these values so that I can relate them to each other, so that when I approach the actor, the coordinates show (0;0).


4) Then I calculate the angle as if it were a right triangle, and it turns out that the x and y coordinate are the cathetes, and then I transform the angle value from (-180,180) to (0,360).

5)Then I rotate the actor, and then I do a little smoothing.

The laser is a vector, a point with the direction the laser pointer is pointing.
here it is


different points were tried, including the top of the head, chest, neck, with additional invisible objects.

The most effective solution I see for me is to use camera tilt, and sort of calculate the error relative to the base point at feet. I’ve shown how I envision it in the figure, but it seems like it would be a lot of overhead and lead to unnecessary calculations.

Thank you for your time.