New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Still have questions? Join our Discord server and get real time help.
Log in to vote

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

Asked by 5 months 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

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

Answer this question