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

My animation script does not work on the roblox website but only in the studio?

Asked by 6 years ago

My script makes a character walk across the screen when you join the game, but it only works in the studio but not on the actual Roblox game. Any help?

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 char ~= nil then --this just checks if the npc exists
    animation:Play() --plays the animation
end
0
Are you using a local script? InfernoExeuctioner 126 — 6y
0
since its an npc you should load the animation into an AnimationController instead of a humanoid https://developer.roblox.com/api-reference/class/AnimationController GoldAngelInDisguise 297 — 6y

Answer this question