Animations bugging out

I tried making FPS arms, but every time I use motor6d on the tool and the arm, the animations are all wonky and messed up.

Here’s how it looks:

Here’s how it should look:

Here’s the function that adds a motor6d and plays an animation:

function changeitem()

	for i,v in pairs(rig.Humanoid:GetPlayingAnimationTracks()) do
		v:Stop()
		if currentanim then
			currentanim:Stop()
		end
	end	

	if olditem then
		olditem.Parent = rs
		grip:ClearAllChildren()
	end

	local item1 = items[num]
	if item1:IsA("Part") then
		item1.CanCollide = false
		item1.CanQuery = false
	elseif item1:IsA("Model") then
		for i, v in pairs(item1:GetChildren()) do
			if v:IsA("Part") then
				v.CanCollide = false
				v.CanQuery = false
			end
		end
	
	
	end
	local foundexample = false
	olditem = item1

	item1.CFrame = grip.CFrame
	item1.Parent = grip
	local motor = Instance.new("Motor6D")
	motor.Parent = grip
	motor.Part0 = grip
	motor.Part1 = item1
		--60.285, -47.528, 138.04
	if item1:FindFirstChild("equipanim") then
		local anim = item1.equipanim
		local anim1 = rig.Humanoid:LoadAnimation(anim)
		currentanim = anim1
		anim1:Play()
		anim1.Ended:Connect(function()
			for i,v in pairs(rig.Humanoid:GetPlayingAnimationTracks()) do
				v:Stop()
				if currentanim then
					currentanim:Stop()
				end
			end	
			if item1:FindFirstChild("idleanim") then
				local anim = item1.idleanim
				local anim1 = rig.Humanoid:LoadAnimation(anim)
				anim1:Play()
				currentanim = anim1
			end
		end)
		
	end
	if item1:FindFirstChild("equipnoise") then
		item1.equipnoise:Play()
	end
	end

Do you have the idle animation on a lower priority than the equip animation?
Do you have the tools default weld destryoed?

I tried making the idle animation a higher priority, it didnt really change anything

It’s not an actual tool so there’s not a weld in it whatsoever. It’s just a part. The script just makes a motor6d between a part in the hand and the part.

Maybe make the equip animation higher priority.

track.Priority = enum.AnimationPriority.Action