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

How do I make animations play in game?

So I watched the TheDevKing's video on how to play animations and I can't seem to get it working.

(Quick note that I am following the script that TheDevKing exactly, time that the script is finished here: https://youtu.be/tnvlWtuCqUw?t=1143)

5 comments

0

What do you mean specifically?

0

Do you want to change the walk animation, idle, etc. or you want a character to play an animation? (for example you click a UI and your character plays an animation)

0

Guess ill answer both..

0

To change character animations: Press play to start (or F5), go to the Workspace and search for your character, inside of him you will see a local script called Animate, copy it, and press stop (or shift + F5) and paste the script in StarterPlayer --> StarterCharacterScripts. To edit the animations you just go inside the script and you will se some values,inside of them there's the animations,

0

or enter the script and modify those ids, in the script you can change the emotes.

1 answer

To make a character play an animation:

This only works in local scripts (i think, im kind of new).

Inside a TextButton, inside a GUI in starterGUI:

local Anim = Instance.new("Animation") -- create the animation.
Anim.AnimationId = "http://www.roblox.com/asset/?id=5517298285" -- Set the Animation's id.
Anim.Parent = script -- Parent the animation to the script.
local Character = game.Players.LocalPlayer.Character -- Get Character.
local AnimLoaded = Character:WaitForChild("Humanoid"):LoadAnimation(Anim) -- Load Animation,we are going to need this for the character to play the anim.

script.Parent.Activated:connect(function() -- Player clicked the UI/GUI.
	AnimLoaded:Play() -- Play the animation.
	wait(3)
	AnimLoaded:Stop() -- Stop Anim.
end)

That should work. BTW dont use that animation, i made it and its really bad.

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