I have a script inside of a NPC and the script contains a Animation as one of its children and the animation plays in studio but not the game.

local char = script.Parent --the npc
local hum = char:WaitForChild("Humanoid")
local animation = hum:LoadAnimation(script.Animation) 
 
if char ~= nil then 
    animation:Play() 
end

4 comments

0

Is this in a local script?

0

what is "Animation"? It needs to be an ID

0

No it doesn't, if you have an actual animation object, then you can load that instead.

0

Its in a server script