Reginald
(Reginald)
June 11, 2021, 4:19am
#1
I want to have animation run and loop
The animation will not run when I play the game
works when I play as run
not when I actually play
This is the code I have in script
local animation = script:WaitForChild('Animation')
local humanoid = script.Parent:WaitForChild('Humanoid')
local flip = humanoid:LoadAnimation(animation)
flip.Looped = true
flip:Play()
1 Like
I suggest changing the code to
local animation = script:WaitForChild('Animation')
local humanoid = script.Parent:WaitForChild('Humanoid')
local animator = humanoid:WaitForChild("Animator")
local flip = animator:LoadAnimation(animation)
flip.Looped = true
flip:Play()
Since LoadAnimation on Humanoid is deprecated.
2 Likes
Reginald
(Reginald)
June 11, 2021, 8:28am
#3
I changed it but I still have the same problem
I am not able to repro this. Is anything else doing something to the model?
Reginald
(Reginald)
June 12, 2021, 4:12am
#5
I fixed it, I just made the animation loop true in the animation editor itself instead of the script
Thanks for the help
1 Like