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

How do you put an Animation in a Humanoid Model?

Asked by 5 years ago

I was wondering, how to put an animation into a humanoid model so that when you play the game, the animation plays.

1 answer

Log in to vote
1
Answered by 5 years ago

This would utilize the the Load Animation function contained within every humanoid. This requires you to do two things.

1.) Create an animation object inside the target model 2.) Create an animation track that loads and controls when the animation is played, stopped, etc.

You can leave the animation object inside the humanoid of the dummy, or alternatively you can modify the script to create one and parent it.

the following script should help you out.

local Dummy = game.Workspace:FindFirstChild("Dummy") -- Locate dummy
local Animation = Dummy.Humanoid:FindFirstChildOfClass("Animation") --Locate animation
local AnimTrack = Dummy.Humanoid:LoadAnimation(Animation) -- Loads the animation

    wait()
    AnimTrack:Play()  -- Plays the animation when the script is run
Ad

Answer this question