Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Playing custom animations?

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

✓ Accepted answer

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!

1 comment

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?

This discussion is preserved as it was. New answers, comments, and votes are closed.