Animating NPC Help

Hi, i’m currently having an issue with animations not working on a npc, i’ve been looking up all the documentation i can find for animation and i still can’t get this animation to play, could anyone look through the code give it a look? - Thanks (Also i’ve check that nothing is anchored)

local Hum = script.Parent:WaitForChild("Humanoid")


local Anim = Instance.new("Animation",script.Parent)
Anim.AnimationId = 'http://www.roblox.com/asset/?id=1018549681'

local track = Hum:LoadAnimation(Anim)

print(track.IsPlaying) -- This Outputs False
track.Looped = true
track:Play()
print(track.IsPlaying) -- this outputs true even though its not playing

1 Like

Two questions to start!

  1. Is this a script or localscript?
  2. Are there any other animations on the NPC?

It’s a script and i’m pretty sure there are no other animations.

1 Like

Capture
I don’t know if this will help at all.

2 Likes

Figured it out!

The ID you’re loading (1018549681) is actually a Roblox asset, which is technically not an animation.

You’ll want to use this ID instead: 910034870.

2 Likes

Thank you! is there a way to easy change a roblox asset in to a animation?

1 Like

Sadly, I don’t believe so.

There’s a few ways to go about it: