How to Have a Different Idle/Walking animation play when tool is equipped?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- This is an example Lua code block

So, I’ve been searching the forum and YT for a while now, but I have found nothing.
Currently, when I am equipping a sword, the idle animation is this:


but, I want to change it to my own animation because I find it weird to be holding a sword like that.
so how might I change the idle/walk animation depending on the tool equipped?

3 Likes

Put a script (not LocalScript!) within the tool (the sword) and copy this code:

local sword = script.Parent

sword.Equipped:Connect(function()
	humanoid = sword.Parent:WaitForChild("Humanoid")
	description = humanoid:GetAppliedDescription()
	local descriptionClone = description:Clone()
	descriptionClone.IdleAnimation = --Put your ID
	descriptionClone.WalkAnimation = --Put your ID
	humanoid:ApplyDescription(descriptionClone)
end)

sword.Unequipped:Connect(function()
	if humanoid and description then
		humanoid:ApplyDescription(description)
	end
end)
2 Likes

I believe this is due to the toolnone Animation being played the moment a Tool gets equipped inside the Animate script

image

What you’d need to do is set the AnimationPriority property for your animation to Action so that it overrides the other default animations, and your Animation can play properly

3 Likes

Screen Shot 2021-04-26 at 9.08.05 AM
that’s all it says. what does it mean?
here is my script:

local sword = script.Parent

sword.Equipped:Connect(function()
	humanoid = sword.Parent:WaitForChild("Humanoid")
	description = humanoid:GetAppliedDescription()
	local descriptionClone = description:Clone()
	descriptionClone.IdleAnimation = 6731665268
	descriptionClone.WalkAnimation = 6731703941
	humanoid:ApplyDescription(descriptionClone)
end)


sword.Unequipped:Connect(function()
	if humanoid and description then
		humanoid:ApplyDescription(description)
	end
end)

here is my explorer:
Screen Shot 2021-04-26 at 9.09.57 AM

and, incase you didn’t know, these are R6 animations and it is an R6 game.

Oh, some animations only work with R15 characters (like these), players (like you) or the game itself have probably an R6 character(s).
To solve this: Go to Game Settings (your game must be published) > Avatar > AvatarType and set it to R15

1 Like

no, the game itself is R6.Screen Shot 2021-04-26 at 9.14.56 AM

i’ll change it to R15, then i’ll add animations that make it look R6 (like oldschool animation type stuff)

Another way to solve that, is to use animations that work with R6 characters.

2 Likes

i was, i was, but it seems it might only work with r15. I’ll have to see

You can use the Animation Editor to create your own animation, but it is quite difficult (for me).

1 Like

ye i use animation editor and moon animator to make them. i’m pretty good at animations tho i think

OK, so make an animation with an R6 character

2 Likes

i thought you said it doesn’t work for R6 characters?

some animations, some…

1 Like

What…?

If your Avatar Type is R6 in the game, and you have R15 Animations already set up, you have to set the Avatar Type to R15 so that the script knows what type of Animation it’s exactly playing to the Character

Although playing R6 on R15 Animations may work, it’ll only play in separate to the HumanoidRootPart and Head parts I’m assuming

2 Likes

I mean some animations work with R6 and another work with R15.

Still you shouldn’t rely on R6 animations to play on R15, it’ll result extremely weird

1 Like

Whatever, I made R15 animations, changed game type to R15… buuuuut, no luck.
Still having the same errors.
Screen Shot 2021-04-26 at 11.10.27 AM

Try doing this maybe?

local Tool = script.Parent

Tool.Equipped:Connect(function()
    local Character = Tool.Parent
    local Animate = Character:WaitForChild("Animate", 3)

    Animate.toolnone.Value = ""
    Animate.idle.Value = "rbxassetid://6731665268"
    Animate.walk.Value = "rbxassetid://6731703941"
 
end)
3 Likes

Players.IceTheOneAndOnly.Backpack.sord.animationscript:7: invalid argument #3 (string expected, got nil)

i have received that error…

maybe this?:

sword.Equipped:Connect(function()
	humanoid = sword.Parent:WaitForChild("Humanoid")
	description = humanoid:GetAppliedDescription()
	local descriptionClone = description:Clone()
	descriptionClone.IdleAnimation = "rbxassetid://6731665268"
	descriptionClone.WalkAnimation = "rbxassetid://6731703941"
	humanoid:ApplyDescription(descriptionClone)
end)
1 Like