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

AnimationTrack

Show deprecated

AnimationTrack

Show deprecated

Controls the playback of an animation on a Humanoid or AnimationController. This object cannot be created, instead it is returned by the Humanoid/LoadAnimation method.

Properties

Animation

Animation

[ReadOnly] [NotReplicated]

The Animation object that was used to create this AnimationTrack.

bool

IsPlaying

[ReadOnly] [NotReplicated]

A read only property that returns true when the AnimationTrack is playing.

float

Length

[ReadOnly] [NotReplicated]

A read only property that returns the length (in seconds) of an AnimationTrack. This will return 0 until the animation has fully loaded and thus may not be immediately available.

bool

Looped

This property sets whether the animation will repeat after finishing. If it is changed while playing the result will take effect after the animation finishes.

AnimationPriority

Priority

This property sets the priority of an AnimationTrack. Depending on what this is set to, playing multiple animations at once will look to this property to figure out which Keyframe Poses should be played over one another.

float

Speed

[ReadOnly] [NotReplicated]

The Speed of an AnimationTrack is a read only property that gives the current playback speed of the AnimationTrack. This has a default value of 1. When speed is equal to 1, the amount of time an animation takes to complete is equal to AnimationTrack/Length (in seconds).

float

TimePosition

[NotReplicated]

Returns the position in time in seconds that an AnimationTrack is through playing its source animation. Can be set to make the track jump to a specific moment in the animation.

float

WeightCurrent

[ReadOnly] [NotReplicated]

WeightCurrent is a read-only property that gives the current weight of the AnimationTrack. It has a default value of 1.

float

WeightTarget

[ReadOnly] [NotReplicated]

WeightCurrent is a read-only property that gives the current weight of the AnimationTrack. It has a default value of 1 and is set when AnimationTrack/Play, AnimationTrack/Stop or AnimationTrack/AdjustWeight is called.

Inherited from Instance: Show Hide

int

DataCost

[ReadOnly] [NotReplicated]

The cost of saving the instance using data persistence.

Instance

Parent

Determines the hierarchical parent of the Instance.

bool

RobloxLocked

If true, the Instance and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted.

string

ClassName

[ReadOnly] [NotReplicated]

A read-only string representing the class this Instance belongs to.

string

Name

A non-unique identifier of the Instance.

bool

Archivable

Determines if an Instance can be cloned using /Instance/Clone or saved to file.

Functions

void

AdjustSpeed ( float speed )

This function changes the AnimationTrack/Speed of an animation. A positive value for speed plays the animation forward, a negative one plays it backwards, and 0 pauses it.

void

AdjustWeight ( float weight , float fadeTime )

Changes the weight of an animation, with the optional fadeTime parameter determining how long it takes for AnimationTrack/WeightCurrent to reach AnimationTrack/WeightTarget.

RBXScriptSignal

GetMarkerReachedSignal ( string name )

This function returns an DataType/RBXScriptSignal|event that fires when a specified KeyframeMarker has been hit in an Animation|animation

double

GetTimeOfKeyframe ( string keyframeName )

Returns the time position of the first Keyframe of the given name in an AnimationTrack.

void

Play ( float fadeTime , float weight , float speed )

Plays the AnimationTrack. Once called an AnimationTrack will play with the specified fadeTime, weight and speed.

void

Stop ( float fadeTime )

Stops the AnimationTrack. Once called playback of the AnimationTrack will stop and the weight of the animation will move towards zero over a length of time specified by the optional fadeTime parameter.

Inherited from Instance: Show Hide

Instance

FindFirstChild ( string name , bool recursive )

Returns the first child of the Instance found with the given name.

Array

GetDescendants ( )

[CustomLuaState]

Returns an array containing all of the descendants of the instance

Objects

GetChildren ( )

Returns an array containing all of the Instance's children.

void

Destroy ( )

Sets the Instance/Parent property to nil, locks the Instance/Parent property, disconnects all connections and calls Destroy on all children.

RBXScriptSignal

GetPropertyChangedSignal ( string property )

Get an event that fires when a given property of an object changes.

string

GetFullName ( )

Returns a string describing the Instance's ancestry.

Instance

FindFirstChildWhichIsA ( string className , bool recursive )

Returns the first child of the Instance for whom Instance/IsA returns true for the given className.

bool

IsAncestorOf ( Instance descendant )

Returns true if an Instance is an ancestor of the given descendant.

bool

IsDescendantOf ( Instance ancestor )

Returns true if an Instance is a descendant of the given ancestor.

Instance

FindFirstChildOfClass ( string className )

Returns the first child of the Instance whose Instance/ClassName|ClassName is equal to the given className.

Instance

FindFirstAncestorWhichIsA ( string className )

Returns the first ancestor of the Instance for whom Instance/IsA returns true for the given className.

Instance

FindFirstAncestorOfClass ( string className )

Returns the first ancestor of the Instance whose Instance/ClassName is equal to the given className.

Instance

FindFirstAncestor ( string name )

Returns the first ancestor of the Instance whose Instance/Name is equal to the given name.

bool

IsA ( string className )

Returns true if an Instance's class matches or inherits from a given class

Instance

WaitForChild ( string childName , double timeOut )

[CustomLuaState] [CanYield]

Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.

string

GetDebugId ( int scopeLength )

[NotBrowsable]

Returns a coded string of the Instances DebugId used internally by Roblox.

Instance

Clone ( )

Create a deep copy of a Roblox instance and descendants where Archivable = true.

void

ClearAllChildren ( )

This function destroys all of an Instance's children.

Events

RBXScriptSignal

DidLoop ( )

This event fires when an AnimationTrack loops on the next update following the end of the previous animation loop.

RBXScriptSignal

KeyframeReached ( string keyframeName )

[Deprecated]

Fires every time playback of an AnimationTrack reaches a Keyframe that does not have the default name - “Keyframe”

RBXScriptSignal

Stopped ( )

Fires whenever the AnimationTrack finishes playing.

Inherited from Instance: Show Hide

RBXScriptSignal

DescendantRemoving ( Instance descendant )

Fires immediately before a descendant of the Instance is removed.

RBXScriptSignal

AncestryChanged ( Instance child , Instance parent )

Fires when the Instance/Parent property of the object or one of its ancestors is changed.

RBXScriptSignal

ChildAdded ( Instance child )

Fires when an object is parented to this Instance.

RBXScriptSignal

ChildRemoved ( Instance child )

Fires when a child is removed from this Instance.

RBXScriptSignal

DescendantAdded ( Instance descendant )

Fires when a descendant is added to the Instance.

RBXScriptSignal

Changed ( string property )

Fired immediately after a property of an object changes.