Loading Animations Through a Tool Help

When I click the tool, the animation was supposed to play here is the script:
> local anim = Instance.New(“Animation”)

local animid = script.Animations.ThrowAnim 
local animplayer = tuple[1].Character.Humanoid:LoadAnimation(animid)

animplayer:Play()

The problem is that it always say that the animation is invalid or cannot load.

1 Like

What’s local anim = Instance.New(“Animation”)?

“Animation” is where the animation id goes from my understanding.

Are you setting the AnimationId of anim with animid? If you are, make sure to load the animation instance instead of the animation ID.

Aka

local animplayer = tuple[1].Character.Humanoid:LoadAnimation(animid)

to

local animplayer = tuple[1].Character.Humanoid:LoadAnimation(anim)

Could be because the Animation is not supported anymore, try a different one for now.

Very easy fix, the problem is your only loading the id, and not the front part. What I do is the same thing as you for my tools. But I make a folder in my tools called “Animations” and inside have all my animations.

In your animation property put your ID in the proper one and in your code do this.
local animplayer = game.Players.LocalPlayer. Humanoid:LoadAnimation(script.Parent.Animations.YOURANIMATIONNAME)