Implement torso offset in FPS arms script

I want to make it so whenever the torso is rotated via animation, this is accounted for in my FPS arms script. My script uses the actual character’s arms instead of a viewmodel. Here’s a video showcasing what I mean:


You can see that the arms stay in the same spot even though the torso rotated. I really don’t know how to go about this so any help would be greatly appreciated!

Code
local RunService = game:GetService("RunService")
local char = script.Parent
local CharStats = char.CharStats
local firstPerson = CharStats.firstPerson
local torso = char.Torso
local hrp = char.HumanoidRootPart
local rightArm = char["Right Arm"]
local leftArm = char["Left Arm"]
local rightShoulder = torso["Right Shoulder"]
local leftShoulder = torso["Left Shoulder"]
local camera = game.Workspace.CurrentCamera

local function transparency()
	rightArm.LocalTransparencyModifier = rightArm.Transparency
	leftArm.LocalTransparencyModifier = leftArm.Transparency
end

local function update()
	local distance = (camera.Focus.Position - camera.CFrame.Position).Magnitude
	if distance <= 1 then
		if firstPerson.Value == false then
			firstPerson.Value = true
			RunService:BindToRenderStep("transparency", Enum.RenderPriority.Character.Value + 1, transparency)
		end

		rightShoulder.C0 = (camera.CFrame * CFrame.new(1, -1, 0)):ToObjectSpace(torso.CFrame):Inverse() * CFrame.Angles(0, math.pi/2, 0)
		leftShoulder.C0 = (camera.CFrame * CFrame.new(-1, -1, 0)):ToObjectSpace(torso.CFrame):Inverse() * CFrame.Angles(0, -math.pi/2, 0)
	elseif firstPerson.Value == true then
		firstPerson.Value = false
		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)
		RunService:UnbindFromRenderStep("transparency")
	end
end

RunService.Stepped:Connect(update)