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

Why dosen't this humanoid load animation work?

local Humanoid = script.Parent

Animation = script:WaitForChild("Animation")

local LoadedAnimation = Humanoid:LoadAnimation(Animation)

LoadedAnimation:Play()

Basically I want to use it to preview animations for a shop, I got the viewport setup but the animation doesn't play.

4 comments

0

Hey there. Where is this script located and what type of script is it?

0

in the humanoid and a regular script

0

Have you gotten any errors?

0

no

2 answers

I tested on my studio and it worked perfectly, I don't know what's wrong with yours but the only thing that I might be able to help with is instead of having the script inside the humanoid, have it in the model, this is the code that I used

local Humanoid = script.Parent:WaitForChild('Humanoid')

local Animation = script:WaitForChild("Animation")

local LoadedAnimation = Humanoid:LoadAnimation(Animation)

LoadedAnimation:Play()

hope this helps! if it works plz accept my answer lol Also, if you are using a localscript, make sure that it is not in the workspace. This means if the parent of the model is workspace

1 comment

0

still dosen't work, could this have something to do with my viewport?

Make a local script located in StarterCharacterScripts. I've tried putting it in StarterPlayerScripts, but for some reason the local character is nil in the script when I put it there. Also make sure the animation is a child of the script, so when the animation goes to the character the animation stays with it.

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