As the title says, I am trying to rotate the character’s UpperTorso so that the RightHand faces something. Normally, the player runs around as normal, but when they aim, I want to always have the gun facing where the camera is pointed to. Aiming forces the player to face the camera’s look-direction similar to shift locking, and there are animations playing on the character which rotate the LowerTorso; meaning the player is not always forward-facing. The best I am able to do is rotate the waist’s C0 when the player looks up or down.
Here is the player looking up and down
The white circle is a BillboardGui placed 100 studs in the direction the camera is facing. The red beam shows the gun’s actual facing direction. The gun is held straight in the right hand, so optimally, the right hand should be facing the gui so that the beam points into the center of the circle. I’ve tried also rotating the waist in the Y axis and messed around with the
CFrame:ToObjectSpace()
method, but nothing has worked so far and I don’t know what to do. This misalignment between the beam and the circle is very noticeable when you change stance or start moving.The LowerTorso rotates to face forward in this animation, which unfortunately rotates the whole UpperTorso and the arms with it.
How do I calculate what I need to rotate the waist by, so that the RightHand (and by extension, the gun) faces directly towards the part in the distance which the BillboardGui is in?