PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

LoadAnimation

This function loads an Animation onto a Humanoid, returning an AnimationTrack that can be used for playback.

How to load an Animation

The following code can be used to load an Animation onto a Humanoid.

local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play()

Should I load an Animation on the client or server?

If the Humanoid is controlled by a particular client, as is the case with Player Player/Character|Characters then Animation|Animations should be loaded and played from that client.

If the Humanoid belongs to a NPC (Non Player Character) which the server has network ownership of then the Animation|Animations should be loaded and played from the server.

Although generally it is not advisable to do so, these rules can be bypassed using the Animator object.

Parameters

Name Type Default Description

The Animation to load

Returns

Return Type Summary

The AnimationTrack created


Code Samples


Humanoid:LoadAnimation

The following would cause the Humanoid to act out the loaded animation.

example=Humanoid:LoadAnimation(script.Parent.AnAnimation)
example:Play()