Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't animations in npc's load?

Asked by 7 years ago

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

0
Try adding wait(1) before it plays and see if it loads? Mayk728 855 — 7y
0
I have tried that, still didn't work RequiredModule 38 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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


0
Nope, still doesn't work RequiredModule 38 — 7y
Ad

Answer this question