Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a script without Humanoid:LoadAnimation?

Asked by 2 years ago

I decided to use this script:

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

But It didn't worked, I was wondering why and founded out that Humanoid:LoadAnimation will not work anymore... And I need help, how do I make an script that does an custom animation I made without It?

1 answer

Log in to vote
1
Answered by 2 years ago

There is something that was replacing Humanoid for :LoadAnimation method. It is called Animator. Animator uses :LoadAnimation now. So instead of doing the method you used, you should do this:

local animation = -- your animation
local humanoid = script.Parent:WaitForChild("Humanoid")
local dance = humanoid:WaitForChild("Animator"):LoadAnimation(animation)
dance:Play()
0
Also, Animator is located as a Descendant of the Humanoid, so thats why I used :WaitForChild Finty_james 269 — 2y
Ad

Answer this question