My NPC animation won't work when I play the game, I need to know what's wrong. This is my code. The code is in a normal script, not local script.
local char = script.Parent --the npc local hum = char:WaitForChild("Humanoid") --the npc's humanoid local animation = hum:LoadAnimation(script.Animation) --finds the animation inside the script and loads it in the npc's humanoid
if hum ~= nil then animation.Looped = true animation:Play() end