To play an animation, you first have to define what humanoid you're playing the animation on.
For the example, I'll take the LocalPlayer
's humanoid for animation.
Next, you have to get the AnimationId from whatever animation plugin you use and insert an Animation
into the script.
Finally, you load the animation onto the previously defined Humanoid.
The final product should be (Because this is using the LocalPlayer
, I will use a LocalScript
inside of StarterGui
.)
local Animation = script.Animation local Humanoid = game.Players.Character:WaitForChild('Humanoid') local Anim = Humanoid:LoadAnimation(Animation) Anim:Play()
The :Play()
functions are exactly the same of that to an audio
.
To learn more about Animation
s, go here
I hope I helped you today! I wish you a merry christmas! :D