So I'm currently making a FPS game, and I have a script that makes the arms follow the mouse, but I noticed that all arm animations are broken when the script is enabled. Can disconnecting Motor6D joints inside torso breaks animations? How can I fix them?

The script

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

 player.Character.Torso["Left Shoulder"].Part1 = nil
 player.Character.Torso["Right Shoulder"].Part1 = nil

local leftarmweld = Instance.new("Weld",  player.Character.Head)
leftarmweld.Name = "LeftArmWeld"
leftarmweld.Part0 = leftarmweld.Parent
leftarmweld.Part1 = player.Character["Left Arm"]
leftarmweld.C0 = leftarmweld.Parent.CFrame:Inverse()
leftarmweld.C1 = player.Character["Left Arm"].CFrame:Inverse()

local rightarmweld = Instance.new("Weld",  player.Character.Head)
rightarmweld.Name = "RightArmWeld"
rightarmweld.Part0 = rightarmweld.Parent
rightarmweld.Part1 = player.Character["Right Arm"]
rightarmweld.C0 = rightarmweld.Parent.CFrame:Inverse() 
rightarmweld.C1 = player.Character["Right Arm"].CFrame:Inverse()

game:GetService("RunService").RenderStepped:Connect(function() --Runs the function each time a frame is rendered.
    mouse.TargetFilter = workspace --This is important when setting the C0 at the bottom as it ignores everything in the workspace to give clean movement of the arms on the Y axis.
    player.Character.Torso.Neck.C1 = CFrame.new() --Sets the C1 to a blank CFrame so the head doesn't glitch.
    player.Character.Torso.Neck.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.asin((mouse.Hit.p - mouse.Origin.p).unit.y), 0, 0) --Moves the head up by 1.5 studs and then sets the angle of your character's neck looking up towards the mouse using inverse trigonometry (A grade maths) and unit vectors (so you only get the direction.)
end)