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

How do you make your character do an animation?

Asked by 7 years ago
Edited 7 years ago

I'm trying to trigger my character to do the dance animation through via the code. How would I do this?

Here is the code I have for this so far:

if x <= 0 then
    script.Parent.Parent.Parent.Enabled = false
    workspace.Button:Destroy()
    --[[ Animation Part --]]

Thanks for helping!

1 answer

Log in to vote
1
Answered by 7 years ago

Animations can be played through use of the LoadAnimation method found in humanoids and AnimationControllers..

Here's an example on how to use 'em:

local Humanoid = script.Parent.Humanoid
local Anim = game:GetService("ReplicatedStorage"):FindFirstChild("Anim")
Humanoid:LoadAnimation(Anim):Play()

For more information on how to use/make these, look at this article: http://wiki.roblox.com/index.php?title=Animations

Ad

Answer this question