Arms following mouse not working with animations

So I have a script to make the player’s arm’s follow the mouse
And it works how it should without any animations.

But when I add an idle animation, it starts the arms starts rotating the wrong axis.

Here’s the script:

local x = -(math.asin((camera.CFrame.Position - mouseHit).unit.y))
local _, y, z = rightShoulder.C0:ToEulerAnglesXYZ()
				
rightShoulder.C0 = CFrame.new(rightShoulderC0.Position) * CFrame.Angles(x, y, z)
		
toolGrip.C0 = rightShoulder.C0 * CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(-1,-0.5,0)

local _, y, z = leftShoulder.C0:ToEulerAnglesXYZ()
leftShoulder.C0 = CFrame.new(leftShoulderC0.Position) * CFrame.Angles(x, y, z)
1 Like

As you can see, it works how it should without animations.

1 Like