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

How do I make a rig use an animation?

Asked by
kyaryx 0
4 years ago

I made a simple animation for a basic humanoid to use, but I don't know how to make it actually use it. Do I use a script, or is there something else at play here?

1 answer

Log in to vote
0
Answered by 4 years ago

Yes, you should use a regular script and place it inside the rig's humanoid. This should work:

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://0"
animation.Parent = script

local loadedAnimation = script.Parent:LoadAnimation(animation)

loadedAnimation:Play()

This will load the animation on the humanoid and then play it. Change the "0" in the animation.AnimationId property to the ID of your animation.

Ad

Answer this question