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

Playing and stopping an animation?

Asked by 5 years ago

How do I play an animation

1 answer

Log in to vote
0
Answered by 5 years ago

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 Animations, go here

I hope I helped you today! I wish you a merry christmas! :D

0
Thanks merry Christmas to you as well User_3805 6 — 5y
Ad

Answer this question