I done this for my project.
You must project mouse cursor location to horizontal plane that is on feet (or pelvis) level of character. This helps aiming also solves weird glitches when you move under door frame or behind some obstacles.
I done it with some trigonometry (solving 2 triangles and some angle, basic math), but recently i found node to project point on plane (sadly forgot exact name of that node).
So find that node and calculate projection point. This will safeguard mouse cursor locations as well, you can even build in more user-proof logic there.
1 Like