Help with animating a tool with the character

So I rigged a Tool in this format:


(Handle Motor6D is being connected to Keycard’s Handle part)
And in the animation editor the thing works:

However, in the game, it looks like this:


Code that does the rigging:

local Character = script.Parent
if not Character:IsA("Model") then repeat Character = script.Parent task.wait(0.1) until Character:IsA("Model") end
Character.DescendantAdded:Connect(function(descendant)
	if descendant:IsA("Weld") and descendant.Name == "RightGrip" then
		task.wait(0.01)
		descendant:Destroy()
		local Motor6D = Instance.new("Motor6D")
		Motor6D.Name = Character:FindFirstChildOfClass("Tool").PrimaryPart.Value.Name
		Motor6D.Part0 = Character.PrimaryPart
		Motor6D.Part1 = Character:FindFirstChildOfClass("Tool").PrimaryPart.Value
		Motor6D.Parent = Character.PrimaryPart
	end
end)
1 Like