Custom Walking Animation When Tool Equipped

Hello devs,

I wanted to make a walking animation when you equip a tool.
How can I do that?

Here is a picture of my tool:

I already made it so when you equip it, you have custom Idle Animation, but I wanted to also make a Walking Animation when you equip it.

Any help is appreciated.

1 Like
local tool = script.Parent
local handle = tool:WaitForChild("Handle")
local animation = tool:WaitForChild("Animation") --place animation instance inside tool (change name if needed)

tool.Equipped:Connect(function()
	local character = tool.Parent
	local humanoid = tool:WaitForChild("Humanoid")
	local anim = humanoid:LoadAnimation(animation)
	anim:Play()
	anim.Looped = true
end)
1 Like

Thanks for the help but now that I have 2 animations, the Idle won’t even work
image

Yes, I set it so that the custom one plays on a loop when the tool is equipped.

local tool = script.Parent
local handle = tool:WaitForChild("Handle")
local animation = tool:WaitForChild("Animation") --place animation instance inside tool (change name if needed)
local anim

tool.Equipped:Connect(function()
	local character = tool.Parent
	local humanoid = tool:WaitForChild("Humanoid")
	anim = humanoid:LoadAnimation(animation)
	anim:Play()
	anim.Looped = true
end)

tool.Unequipped:Connect(function()
	anim:Stop()
end)

This will stop it when the tool is unequipped, from there you’re welcome to add in support for other animations to be played.

1 Like

Okay the Idle Animation works again now but for some reason the walk animation is still not playing. Maye because I used Roblox’s Knight Animation? Do I have to make my own?

I’m not familiar with that animation but I’m guessing you have to be moving below a certain walkspeed for it to trigger otherwise the standard running animation will play.

1 Like

Didn’t work :frowning_face: Thanks for the help tho, I’ll try to make it work and I’ll contact you here if I did

Set your WalkSpeed to 5 or something small and try walking around.

Okay i’ll try doing that right now

Nope, still doesn’t work unfortunately

I’d recommend creating a new thread, perhaps someone else might be more familiar with that animation package.

From what I recall walking animations should play when the walkspeed is low but that might not be the same for custom animations.

1 Like

I tried everything, I tried setting my walkspeed to a low number, I tried doing it with my own animation or Roblox’s animation

It doesn’t play it

The custom and idle that you wanted to play when the tool is equipped/unequipped is working though right?

No, i don’t know why. I even copied your code

I thought you mentioned here that it was working.

Yeah the Idle works but not the Walk

The animation doesn’t change when I move with the tool

Just to let you know the code I’ve been providing are examples, they won’t work if directly copied & pasted and will need modifying to work.