How to make the arms of the character point down based on how close the character is to the mouse

I have a isometric camera system where the arms follow where the cursor, since the camera is looking down on the player the tilt isn’t normalized and you have to point the cursor much higher than the target, more issues arise when you attempt to move the cursor behind the character where the arms will just point down. Any response(code, suggestion) will be helpful, thanks!

The current arm code:

Character.Torso["Right Shoulder"].C0 = Character.Torso["Right Shoulder"].C0:Lerp(CFrame.new(1, 0.65, 0) * CFrame.Angles(-math.asin((cursorPos.Origin.p - cursorPos.Hit.p).unit.y), 1.55, 0) , 0.1)

Character.Torso["Left Shoulder"].C0 = Character.Torso["Left Shoulder"].C0:Lerp(CFrame.new(-1, 0.65, 0) * CFrame.Angles(-math.asin((cursorPos.Origin.p - cursorPos.Hit.p).unit.y), -1.55, 0) , 0.1)

Video:

1 Like

You should cast a ray through the camera towards the mouse (camera has some functions for helping generate this). Then take the raycast hit position and make the arms point to that.