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

Animation Not Playing when clicking play?

So i have a animation script on my NPC but the problem is that it only works when clicking run and not when clicking play or play here, why is that?

here is the animation script

local animation = script:WaitForChild('WaveAnim')
local humanoid = script.Parent:WaitForChild('Humanoid')
local dance = humanoid:LoadAnimation(animation)
dance:Play()
dance.Looped = true

4 comments

1

make sure the priority is the right priority

1

what do you mean? Im pretty new to roblox studio

0

dance.Priority = Enum.AnimationPriority.Action

0

Sorry but it is still not working

1 answer

I inserted my character in the game and i am loading the run animation. Here is the script i made (it work also when i press play, run, play here):

--Getting the animation
local Animation = script:WaitForChild("RunAnim")
--Getting the Humanoid
local Humanoid = script.Parent:WaitForChild("Humanoid")
--Loading The Animation
local LoadedAnimation = script.Parent.Humanoid:LoadAnimation(Animation)
--Setting the animation so it will not stop
LoadedAnimation.Looped = true
--Playing the animation
LoadedAnimation:Play()

1 comment

0

Change the 2nd line to: local Animation = script:WaitForChild("WaveAnim")

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