Converting weapon position from right arm to torso

So I have a gun animation where the gun is welded to the right arm. However I am trying to convert it to be welded to the Torso without changing the position of the gun. I am doing this by editing a KeyframeSequence.

I have this code (ran from commandbar):

local KeyframeSequence = game:GetService("Selection"):Get()[1]
local DefaultRightShoulderC0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
local DefaultRightShoulderC1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)

for _, keyframe in pairs(KeyframeSequence:GetChildren()) do
    local body = keyframe.HumanoidRootPart.Torso["Right Arm"].Body -- This is the main part of the gun
    body.Parent = keyframe.HumanoidRootPart.Torso
    body.CFrame = body.CFrame * DefaultRightShoulderC0 * DefaultRightShoulderC1:Inverse() * keyframe.HumanoidRootPart.Torso["Right Arm"].CFrame
end

I’ve tried lots of different combinations but I just can’t seem to figre it out. Any help appreciated.