Arms breaking when i move the camera around

when i spin the camera for a little bit, the arms break


here is the code for making the arms follow the camera

local player = game.Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
	character = player.CharacterAdded:wait()
end
local humanoid = character:WaitForChild("Humanoid")
local torso = character:WaitForChild("Torso")
local rightShoulder = torso:WaitForChild("Right Shoulder")
local leftShoulder = torso:WaitForChild("Left Shoulder")
local camera = game.Workspace.CurrentCamera

local updateSpeed = 0.5
local newLook

game:GetService("RunService").RenderStepped:Connect(function()
	--character["Right Arm"].LocalTransparencyModifier = character["Right Arm"].Transparency
	--character["Left Arm"].LocalTransparencyModifier = character["Left Arm"].Transparency
	local delta = game:GetService("UserInputService"):GetMouseDelta()
	local unlocker = CFrame.Angles(-delta.y/500, -delta.x/500, 0)
	
	local camCF = camera.CFrame * CFrame.new(1.5, 1, 0.3):Inverse()
	if humanoid.Health > 0 and character:FindFirstChildOfClass("Tool") then
		newLook = ((newLook or CFrame.new(0, 0, 0)) * unlocker)
		local newCamCF = camCF * newLook
		local rightC0 = newCamCF * CFrame.new(1, -1, 0)
		local leftC0 = newCamCF * CFrame.new(-1, -1, 0)
		rightShoulder.C0 = rightShoulder.C0:Lerp(rightC0:ToObjectSpace(torso.CFrame):Inverse() * CFrame.Angles(0, math.pi/2, 0), updateSpeed)
		leftShoulder.C0 = leftShoulder.C0:Lerp(leftC0:ToObjectSpace(torso.CFrame):Inverse() * CFrame.Angles(0, -math.pi/2, 0), updateSpeed)
	else
		newLook = nil
		rightShoulder.C0 = CFrame.new(1, 0.5, 0) * CFrame.Angles(0, math.pi/2, 0)
		leftShoulder.C0 = CFrame.new(-1, 0.5, 0) * CFrame.Angles(0, -math.pi/2, 0)
	end
end)
2 Likes

bump, tried doing this and it broke even more
image

you should do

CFrame.lookAt(newLook.Position, newLook.Position+newLook.LookVector*2048)

same thing as before
​​​​​​​​​​​​​​​

nevermind i fixed it myself, here is what i did

apparently this breaks the arms more when you look up further
looking for new responses