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

Playing custom animations?

Asked by 9 years ago

I just made some custom animations with the Roblox animation creation plugin. To play them I can replace some of the Animate script contect in the character but I know that there is another way to play them. My question is how can I play animations?

1 answer

Log in to vote
1
Answered by 9 years ago

You have to load animation first in the humanoid, than play like it's an audio clip.


LoadAnimation

workspace.Player1.Humanoid:LoadAnimation(animation)

Play is simple.

animation:play()

So we do this:

script.Parent.Touched:connect(function(part) --When a player touches this part:
    local h = part.Parent:FindFirstChild("Humanoid")
    if h then
        local animation = script.Animation
        local readyanim = h:LoadAnimation(animation)
        readyanim:Play() --They do this animation. Edit this script to your liking.
    end
end)

Hope it helps!

0
The output says "Argument 1 missing or nil" in the output and points to the issue being on line 5. Any help fixing that? Scootakip 299 — 8y
Ad

Answer this question