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

My NPC animation only work when you run the game but not play the game. Why?

Asked by 5 years ago

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

1
Can you post your code in the right format so that it's easier to read and respond too FallenZalio 99 — 5y

Answer this question