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

How Do I Load An Animation?

Asked by
itsJooJoo 195
8 years ago

So I made an animation, exported it to roblox, and now I don't know what to do with it. It is a custom walking animation. How would I put this into every player and play it?

1 answer

Log in to vote
0
Answered by
xuefei123 214 Moderation Voter
8 years ago

To play an animation you need to load it into the humanoid, here is a basic example of how to load an animation and play it.

--LocalScript
-- Import animation
local animation = Instance.new("Animation")
animation.AnimationId = "AnimationID"
local player = game.Players.LocalPlayer
player.CharacterAdded:connect(function())
    player.Character.Humanoid:LoadAnimation(animation)--Loads the animtion into the character
    animation:Play()--Plays the animation
end)


If this helped then don't forget to hit that accept answer button, it gives us both rep!

0
Thanks! Also, how do you put in a jumping animation? itsJooJoo 195 — 8y
0
You gotta connect it to a changed event and connect that to Humanoid.Jump.Changed xuefei123 214 — 8y
Ad

Answer this question