Collapse Sidebar


This function loads an Animation onto an AnimationController, 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 an AnimationController.

local animationTrack = animationController:LoadAnimation(animation)

Should I load an Animation on the client or server?

In order for AnimationTracks to replicate correctly, it’s important to know when they should be loaded on the client (via a LocalScript) or on the server (via a Script). If an AnimationController is created on the server, its animations should be loaded and played on the server unless a player has been assigned network ownership of the Model's root part using BasePart/SetNetworkOwner. If an AnimationController is created on the client it should be animated by the client.

Although it is not recommended, if a developer wishes to play animations on a locally controlled Model from the server they can use the Animator object.

Note this differs slightly for animations playing on Player characters, for more information on this please see Humanoid/LoadAnimation.


Name Type Default Description

The Animation to be used.


Return Type Summary

The AnimationTrack created.

Code Samples

Using an AnimationController to animation non-player objects

This code sample demonstrates how an AnimationController can be used in place of a Humanoid for non player character objects.

A basic rig is loaded using InsertService and the default Humanoid is replaced with an AnimationController. An AnimationTrack is then created and played.