Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Char animation doesn't work outside of studio?

It's a script inside of a zombie along with an animation. Theoretically, it should simply play the animation (as it does in studio). When I view it from the actual game, however, nothing happens.

local hum = script.Parent.Humanoid

local anim = hum:LoadAnimation(script.Parent.dance)

anim:Play()

Why is it that scripts don't work in the game when they work just fine in studio? This isn't the first one I've had issues with.

2 comments

0

Your script is work fine, maybe you forgot to publish it. After that, check it again.

0

That's what I thought too, but I double checked and it is indeed published.

2 answers

maybe change the first line to this:

local hum = script.Parent:FindFirstChild("Humanoid")

if this works, dont forget to accept the answer

im gtg so if u have comment ill talk to u later

Hello there.

I also have been through this situation too, so I have experience.

I suggest doing this option:

local character = script.Parent
while not character do
	character.AncestryChanged:Wait()
end
local humanoid = script.Parent:WaitForChild('Humanoid')

local anim = humanoid:LoadAnimation(script.Parent.Animation)
anim:Play()

Try checking if your animation is looped, because the game takes time to load your game, and the animation would have already stopped by the time the game loaded.

This discussion is preserved as it was. New answers, comments, and votes are closed.