Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why won't animations in npc's load?

I've literally been working all day on this dumb script because for some reason the animation won't load outside of studio. It works in studio in regular playing mode and on a test server. But when I try it in game it never loads.

Yes it is my animation. Yes it is the right id. There is no reason why it shouldn't work

Script:

local Animation = script:WaitForChild("Animation")
local Humanoid = script.Parent:WaitForChild("Humanoid")
local Action = Humanoid:LoadAnimation(Animation)

Action:Play()

Here is a snippet: https://gyazo.com/43d6a1a300f54f675f1814bbdce24a50

2 comments

0

Try adding wait(1) before it plays and see if it loads?

0

I have tried that, still didn't work

1 answer

If you're loading an animation into an NPC you can use this ...

while wait(5) do
local animation = Instance.new("Animation")
animation.AnimationId = "ANIMATION LINK" -- your id here

local animTrack = script.Parent:LoadAnimation(animation) 
animTrack:Play()
end


1 comment

0

Nope, still doesn't work

This discussion is preserved as it was. New answers, comments, and votes are closed.