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
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()