Animation not playing

I want to make a sword to a game.

But i have a problem and that is that the animation wont play.

I have tried solving the problem but theres no errors it just don’t play. This is in a Script and it worked in a local script but then it won’t play for tthe rest of all players.

Here you have my code:
image

Humanoid:LoadAnimation() is deprecated. Instead, use Animator:LoadAnimation()

Here’s the link for the documentation: Animator | Roblox Creator Documentation

1 Like

But then how do i get the Animator?

Use the Command Bar. By typing: Instance.new("Animator", PUT THE PARENT HERE)

2 Likes

Ok i will try that later i need to go now.

1 Like

Every player character already has an animator parented to humanoid, so you would do:

Humanoid.Animator:LoadAnimation(Animation)

but @BriefTaste solution can also work incase there is no animator

2 Likes

You can still load animations from the character’s “Humanoid” instance even if this approach has been deprecated, your issue likely revolves around animation ownership, you need to have uploaded the animation yourself for it to be played, if it has been uploaded by someone else (and thus belongs to another user’s account) then the animation will not play. Similarly, group uploaded animations are required for group experiences.