How to animate character's not attached parts

I have this piece of code that I am using to skip the process of making a viewmodel and instead use player’s actual arms. The problem is when I deattach the arms (Motor6D.Part1 = nil) the animation on the arms stops playing.
How do I resolve this?
Thanks.

local ROffset = CFrame.new(0.9,-0.9,0)
local LOffset = CFrame.new(-0.9,-0.9,0)
local camera = workspace.CurrentCamera
local head = script.Parent:WaitForChild("Head")
local function IsFirstPerson()
	return (head.CFrame.p - camera.CFrame.p).Magnitude < 1
end
game:GetService("RunService").RenderStepped:Connect(function()
	if IsFirstPerson() == true then
			script.Parent["Right Arm"].LocalTransparencyModifier = 0.5
		script.Parent["Left Arm"].LocalTransparencyModifier = 0.5
	end
	if script.Parent:FindFirstChildOfClass("Tool") ~= nil then
		script.Parent["Right Arm"].CFrame = workspace.CurrentCamera.CFrame * ROffset
		script.Parent["Left Arm"].CFrame = workspace.CurrentCamera.CFrame * LOffset
		script.Parent.Torso["Left Shoulder"].Part1 = nil
		script.Parent.Torso["Right Shoulder"].Part1 = nil
	else
		script.Parent.Torso["Left Shoulder"].Part1 = script.Parent["Left Arm"]
		script.Parent.Torso["Right Shoulder"].Part1 = script.Parent["Right Arm"]
	end
end)
2 Likes

you can’t animate parts through an AnimationController if they aren’t connected to the rig, but you could make the arms a seperate entity (arms as Model with AnimationController, rig them together) and then animate them there

After thinking of solutions, I thought of simply editing the C0/C1 of motor6d’s. Does anyone know what black magic is required to use this method?