Why won't this left arm movement work properly? (CFrame)

Recently I have been working on a Zombie Tower game, but I have had a problem with the gun. In the script, it makes first person arms follow the camera, but only the right arm works. Here is the script.

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

game["Run Service"].RenderStepped:Connect(function()
	local rightX, rightY, rightZ = player.Character.Torso["Right Shoulder"].C0:ToEulerAnglesYXZ()
	player.Character.Torso["Right Shoulder"].C0 = (player.Character.Torso["Right Shoulder"].C0 * CFrame.Angles(0, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))

	local leftX, leftY, leftZ = player.Character.Torso["Left Shoulder"].C0:ToEulerAnglesYXZ()
	player.Character.Torso["Left Shoulder"].C0 = (player.Character.Torso["Left Shoulder"].C0 * CFrame.Angles(0, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
end)

Here is what happens:

Any help is appreciated.

On the last line, put a negative before math.asin()
I would imagine this is necessary because the axes are inverted.

Yes, this works. Thank you so much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.