Tool idle animation not working

Me and my friend have been trying to get an idle animation for our punching script but nothing we do works.

when we equip the punching tool all it does is stick our hand out.

Here’s the script

local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://13026274633"
local track
tool.Equipped:Connect(function()
	track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
	track.Priority = Enum.AnimationPriority.Action
	track.Looped = true
	track:Play()
end)
tool.Unequipped:Connect(function()
	if track then
		track:Stop()
	end
end)

this (should) work.

local tool = script.Parent
local anim = Instance.new("Animation", workspace)
anim.AnimationId = "rbxassetid://13026274633"
local track
tool.Equipped:Connect(function()
	track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
	track.Priority = Enum.AnimationPriority.Action
	track.Looped = true
	track:Play()
end)
tool.Unequipped:Connect(function()
	if track then
		track:Stop(); 
	end
end)
1 Like

Very nice, it works. Could you tell us what we kept getting wrong?

according to my experience, if the animation is not in workspace it wouldn’t play.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.