Arms endlessly rotating with camera

I’m making a third person shooter, and I’m wanting the arms to rotate with the camera whilst the player aims the gun. However, this happens:

The arms infintely rotate; their speed defined by the camera’s rotation.

There is the snippet of code below, which is executed each frame.

local x, y, z = Camera.CFrame:ToOrientation()

Player.Character.Torso['Right Shoulder'].C1 = Player.Character.Torso['Right Shoulder'].C1 * CFrame.Angles(0,0,math.rad(-x))
Player.Character.Torso['Left Shoulder'].C1 = Player.Character.Torso['Left Shoulder'].C1 * CFrame.Angles(0,0,math.rad(x))

Any help would be appreciated.

This is because C1 has a rotation which is multiplied by another rotation causing infinite rotation.

I believe you can just use rotation plus position instead.

C1 = CFrame.Angles(0,0,math.rad(-x)) + C1.Position

When I use that equation, I end up turning into this abomination:

It does this no matter which axis I put the math.rad(-x) in…

And here’s the line of code again just in case I’ve made an error:

Player.Character.Torso['Right Shoulder'].C1 =  CFrame.Angles(0,0,math.rad(-x)) + Player.Character.Torso['Right Shoulder'].C1.p

Try referencing to this topic it might help:

Try searching “aim gun to face mouse” in the Search bar up top. This has been answered in other posts.

I’ve looked before, and most of them use the same formulas I did, which if you can tell by the code I provided and the video, don’t work. Could you please link one that uses another method?

I’m guessing there’s an initial offset rotation to the arms.

Outside of the loop store it.

C1RotatationStore = C1.Rotation

Then add it on to the formula

C1 = CFrame.Angles(0,0,math.rad(-x))*C1RotatationStore+ C1.Position

Sorry but that isn’t working either, my character’s arms just stay still.