Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
AnimationTrack
Inherits from: Instance → Object
Controls the playback of an animation on an Animator. This object cannot be created, instead it is returned by the Animator:LoadAnimation() method.
Inherits from: Instance
Memory category: Animation
Tags: NotCreatable
Properties
| Name | Type / Returns | Description |
|---|---|---|
| AnimationTrack.Animation | Animation | The Animation object that was used to create this AnimationTrack. |
| AnimationTrack.IsPlaying | boolean | A read-only property that returns true when the AnimationTrack is playing. |
| AnimationTrack.Length | float | 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. |
| AnimationTrack.Looped | boolean | Sets whether the animation will repeat after finishing. If it is changed while playing the result will take effect after the animation finishes. |
| AnimationTrack.Priority | AnimationPriority | 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. |
| AnimationTrack.Speed | float | Read-only property that gives the current playback speed of the AnimationTrack. |
| AnimationTrack.TimePosition | float | 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. |
| AnimationTrack.WeightCurrent | float | Read-only property that gives the current weight of the AnimationTrack. |
| AnimationTrack.WeightTarget | float | Read-only property that gives the current weight of the AnimationTrack. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.Archivable | boolean | Determines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published. |
| Instance.archivable | boolean | |
| Instance.Capabilities | SecurityCapabilities | The set of capabilities allowed to be used for scripts inside this container. |
| Instance.IsInSandbox | boolean | Indicates whether the instance is inside a sandboxed container. |
| Instance.Name | string | A non-unique identifier of the Instance. |
| Instance.Parent | Instance | Determines the hierarchical parent of the Instance. |
| Instance.PredictionMode | PredictionMode | Reflects the client-side prediction mode applied to the instance under server-authoritative physics. |
| Instance.RobloxLocked | boolean | A deprecated property that used to protect CoreGui objects. |
| Instance.Sandboxed | boolean | When enabled, the instance can only access abilities in its Capabilities list. |
| Instance.UniqueId | UniqueId | A unique identifier for the instance. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.ClassName | string | A read-only string representing the class this Object belongs to. |
| Object.className | string |
AnimationTrack.Animation
The Animation object that was used to create this AnimationTrack. To create an AnimationTrack, you must load an Animation object onto an Animator using the Animator:LoadAnimation() method.
| Field | Value |
|---|---|
| type | Animation |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":false} |
| capabilities | ["Animation"] |
Code samples: View on Creator Hub (AnimationPlayed).
AnimationTrack.IsPlaying
A read-only property that returns true when the AnimationTrack is playing.
This property can be used to check if an animation is already playing before playing it (as that would cause it to restart). If you want to obtain all playing AnimationTracks on an Animator or a Humanoid, they should use Animator:GetPlayingAnimationTracks()
| Field | Value |
|---|---|
| type | boolean |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":false} |
| capabilities | ["Animation"] |
| simulationAccess | true |
Code samples: View on Creator Hub (AnimationTrack-IsPlaying).
AnimationTrack.Length
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.
When the AnimationTrack.Speed of an AnimationTrack is equal to 1, the animation will take AnimationTrack.Length (in seconds) to complete.
| Field | Value |
|---|---|
| type | float |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":false} |
| capabilities | ["Animation"] |
Code samples: View on Creator Hub (Animation-Speed-2).
AnimationTrack.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.
This property defaults to how it was set in the Animation Editor. However, this property can be changed, allowing control over the AnimationTrack while it is running. This property also correctly handles animations played in reverse (negative AnimationTrack.Speed). After the first keyframe is reached, it will restart at the last keyframe.
| Field | Value |
|---|---|
| type | boolean |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":false} |
| capabilities | ["Animation"] |
| simulationAccess | true |
Code samples: View on Creator Hub (Animation-Looping, AnimationTrack-DidLoop).
AnimationTrack.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. It uses AnimationPriority which has 7 priority levels:
Properly set animation priorities, either through the Animation Editor or through this property, allow multiple animations to be played without them clashing. Where two playing animations direct the target to move the same limb in different ways, the AnimationTrack with the highest priority will show. If both animations have the same priority, the weights of the tracks will be used to combine the animations.
| Field | Value |
|---|---|
| type | AnimationPriority |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Animation"] |
| simulationAccess | true |
AnimationTrack.Speed
This read-only property gives the current playback speed of the AnimationTrack. When equal to 1, the amount of time an animation takes to complete is equal to AnimationTrack.Length, in seconds.
If the speed is adjusted through AnimationTrack:AdjustSpeed(), the actual time it will take a track to play can be computed by dividing the length by the speed. Speed is a unitless quantity.
| Field | Value |
|---|---|
| type | float |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":false} |
| capabilities | ["Animation"] |
| simulationAccess | true |
Code samples: View on Creator Hub (Animation-Speed, Animation-Speed-2).
AnimationTrack.TimePosition
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, but the AnimationTrack must be playing to do so. It can also be used in combination with AnimationTrack:AdjustSpeed() to freeze the animation at a desired point by setting speed to 0.
| Field | Value |
|---|---|
| type | float |
| tags | ["NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":true,"can_save":false} |
| capabilities | ["Animation"] |
| simulationAccess | true |
Code samples: View on Creator Hub (Animation-TimePosition).
AnimationTrack.WeightCurrent
When weight is set in an AnimationTrack it does not change instantaneously but moves from AnimationTrack.WeightCurrent to AnimationTrack.WeightTarget. The time it takes to do this is determined by the fadeTime parameter given when the animation is played, or the weight is adjusted.
AnimationTrack.WeightCurrent can be checked against AnimationTrack.WeightTarget to see if the desired weight has been reached. Note that these values should not be checked for equality with the == operator, as both of these values are floats. To see if AnimationTrack.WeightCurrent has reached the target weight, it is recommended to see if the distance between those values is sufficiently small.
| Field | Value |
|---|---|
| type | float |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":false} |
| capabilities | ["Animation"] |
| simulationAccess | true |
Code samples: View on Creator Hub (AnimationWeight).
AnimationTrack.WeightTarget
This read-only property 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. When weight is set in an AnimationTrack it does not change instantaneously but moves from AnimationTrack.WeightCurrent to AnimationTrack.WeightTarget. The time it takes to do this is determined by the fadeTime parameter given when the animation is played, or the weight is adjusted.
AnimationTrack.WeightCurrent can be checked against AnimationTrack.WeightTarget to see if the desired weight has been reached. Note that these values should not be checked for equality with the == operator, as both of these values are floats. To see if AnimationTrack.WeightCurrent has reached the target weight, it is recommended to see if the distance between those values is sufficiently small.
| Field | Value |
|---|---|
| type | float |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":false} |
| capabilities | ["Animation"] |
| simulationAccess | true |
Code samples: View on Creator Hub (AnimationWeight).
Methods
| Name | Type / Returns | Description |
|---|---|---|
| AnimationTrack:AdjustSpeed | () | 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. |
| AnimationTrack:AdjustWeight | () | Changes the weight of an animation, with the optional fadeTime parameter determining how long it takes for AnimationTrack.WeightCurrent to reach AnimationTrack.WeightTarget. |
| AnimationTrack:GetMarkerReachedSignal | RBXScriptSignal | Returns an RBXScriptSignal (event) that fires when a specified KeyframeMarker has been hit in an animation. |
| AnimationTrack:GetParameter | Variant | Returns the value of a parameter on the animation graph by key. Returns nil if the parameter has not been set. |
| AnimationTrack:GetParameterDefaults | Dictionary | Returns a dictionary of parameter values initially set as instance attributes on the Class.AnimationGraphDefinition instance used to build the animation graph inside this track. |
| AnimationTrack:GetTimeOfKeyframe | double | Returns the time position of the first Keyframe of the given name in an AnimationTrack. |
| AnimationTrack:Play | () | Plays the AnimationTrack. Once called an AnimationTrack will play with the specified fadeTime, weight and speed. |
| AnimationTrack:SetParameter | () | Sets a parameter value on the animation graph, driving animation graph node inputs. |
| AnimationTrack:Stop | () | Stops the AnimationTrack. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance:AddTag | () | Applies a tag to the instance. |
| Instance:children | Instances | Returns an array of the object's children. |
| Instance:ClearAllChildren | () | This method destroys all of an instance's children. |
| Instance:Clone | Instance | Create a copy of an instance and all its descendants, ignoring instances that are not Archivable. |
| Instance:clone | Instance | |
| Instance:Destroy | () | Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children. |
| Instance:destroy | () | |
| Instance:FindFirstAncestor | Instance? | Returns the first ancestor of the Instance whose Instance.Name is equal to the given name. |
| Instance:FindFirstAncestorOfClass | Instance? | Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className. |
| Instance:FindFirstAncestorWhichIsA | Instance? | Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstChild | Instance? | Returns the first child of the Instance found with the given name. |
| Instance:findFirstChild | Instance | |
| Instance:FindFirstChildOfClass | Instance? | Returns the first child of the Instance whose ClassName is equal to the given class name. |
| Instance:FindFirstChildWhichIsA | Instance? | Returns the first child of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstDescendant | Instance? | Returns the first descendant found with the given Instance.Name. |
| Instance:GetActor | Actor? | Returns the Actor associated with the Instance, if any. |
| Instance:GetAttribute | Variant | Returns the value which has been assigned to the given attribute name. |
| Instance:GetAttributeChangedSignal | RBXScriptSignal | Returns an event that fires when the given attribute changes. |
| Instance:GetAttributes | Dictionary | Returns a dictionary of the instance's attributes. |
| Instance:GetChildren | Instances | Returns an array containing all of the instance's children. |
| Instance:getChildren | Instances | |
| Instance:GetDebugId | string | Returns a coded string of the debug ID used internally by Roblox. |
| Instance:GetDescendants | Instances | Returns an array containing all of the descendants of the instance. |
| Instance:GetFullName | string | Returns a string describing the instance's ancestry. |
| Instance:GetStyled | Variant | Returns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified. |
| Instance:GetStyledPropertyChangedSignal | RBXScriptSignal | Returns an event that fires when the given style property changes on the instance. |
| Instance:GetTags | Array | Gets an array of all tags applied to the instance. |
| Instance:HasTag | boolean | Check whether the instance has a given tag. |
| Instance:IsAncestorOf | boolean | Returns true if an Instance is an ancestor of the given descendant. |
| Instance:IsDescendantOf | boolean | Returns true if an Instance is a descendant of the given ancestor. |
| Instance:isDescendantOf | boolean | |
| Instance:IsPropertyModified | boolean | Returns true if the value stored in the specified property is not equal to the code-instantiated default. |
| Instance:QueryDescendants | Instances | Returns an array containing all descendants of the instance that match the selector string. |
| Instance:Remove | () | Sets the object's Parent to nil, and does the same for all its descendants. |
| Instance:remove | () | |
| Instance:RemoveTag | () | Removes a tag from the instance. |
| Instance:ResetPropertyToDefault | () | Resets a property to its default value. |
| Instance:SetAttribute | () | Sets the attribute with the given name to the given value. |
| Instance:WaitForChild | Instance | 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. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object:GetPropertyChangedSignal | RBXScriptSignal | Get an event that fires when a given property of the object changes. |
| Object:IsA | boolean | Returns true if an object's class matches or inherits from a given class. |
| Object:isA | boolean |
AnimationTrack:AdjustSpeed
This method 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.
A track's initial speed is set as a parameter in AnimationTrack:Play(). However a track's AnimationTrack.Speed can be changed during playback using this method. When speed is equal to 1, the amount of time an animation takes to complete is equal to AnimationTrack.Length (in seconds).
When is adjusted, then the actual time it will take a track to play can be computed by dividing the length by the speed. AnimationTrack.Speed is a unitless quantity.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| speed | float | 1 | The playback speed the animation is to be changed to. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| tags | ["CustomLuaState"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Animation"] |
| simulationAccess | true |
Code samples: View on Creator Hub (Animation-Speed-2, Animation-Speed).
AnimationTrack:AdjustWeight
Changes the weight of an animation, with the optional fadeTime parameter determining how long it takes for AnimationTrack.WeightCurrent to reach AnimationTrack.WeightTarget.
When weight is set in an AnimationTrack it does not change instantaneously but moves from AnimationTrack.WeightCurrent to AnimationTrack.WeightTarget. The time it takes to do this is determined by the fadeTime parameter given when the animation is played, or the weight is adjusted.
The animation weighting system is used to determine how AnimationTracks playing at the same priority are blended together. The default weight is 1, and no movement will be visible on an AnimationTrack with a weight of 0. The pose that is shown at any point in time is determined by the weighted average of all the Poses and the AnimationTrack.WeightCurrent of each AnimationTrack. See below for an example of animation blending in practice. In most cases blending animations is not required and using AnimationTrack.Priority is more suitable.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| weight | float | 1 | The weight the animation is to be changed to. |
| fadeTime | float | 0.100000001 | The duration of time that the animation will fade between the old weight and the new weight for. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| tags | ["CustomLuaState"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Animation"] |
| simulationAccess | true |
Code samples: View on Creator Hub (AnimationTrack-Change-Weight).
AnimationTrack:GetMarkerReachedSignal
This method returns an RBXScriptSignal (event) similar to the AnimationTrack.KeyframeReached event, except it only fires when a specified KeyframeMarker has been hit in an animation. The difference allows for greater control of when the event will fire.
To learn more about using this method, see here.
See Also
KeyframeMarkerAnimationTrack, controls the playback of an animation on aHumanoidorAnimationControllerKeyframe, holds thePosesapplied to joints in aModelat a given point of time in an animationKeyframe:AddMarker()Keyframe:RemoveMarker()Keyframe:GetMarkers()
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| name | string | The name of the KeyframeMarker the signal is being created for. Not to be confused with the name of the Keyframe. |
Returns
| Type | Description |
|---|---|
| RBXScriptSignal | The signal created and fired when the animation reaches the created KeyframeMarker. |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Animation"] |
Code samples: View on Creator Hub (listening-to-keyframemarkers).
AnimationTrack:GetParameter
Returns the value of a parameter on the animation graph by key. If the parameter has not been set via AnimationTrack:SetParameter(), this method returns nil.
Parameters are used to drive inputs on animation graph nodes. Use this method to read back the current value of a parameter that was previously set with AnimationTrack:SetParameter().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| key | string | The name of the parameter to retrieve. |
Returns
| Type | Description |
|---|---|
| Variant | The current value of the parameter, or nil if not set. |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Animation"] |
| simulationAccess | true |
AnimationTrack:GetParameterDefaults
Returns a dictionary of default parameter values defined by the animation graph. This can be used to discover what parameters are available on an animation graph and their initial values.
If the underlying Animation is not an animation graph, this method returns an empty dictionary.
Returns
| Type | Description |
|---|---|
| Dictionary | A dictionary mapping parameter names to their default values. Returns an empty dictionary if the animation is not an animation graph. |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Animation"] |
AnimationTrack:GetTimeOfKeyframe
Returns the time position of the first Keyframe of the given name in an AnimationTrack. If multiple Keyframes share the same name, it will return the earliest one in the animation.
This method will return an error if it is uses with an invalid keyframe name (one that does not exist for example) or if the underlying Animation has not yet loaded. To address this make sure only correct keyframe names are used and the animation has loaded before calling this method.
To check if the animation has loaded, verify that the AnimationTrack.Length is greater than zero.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| keyframeName | string | The name associated with the Keyframe to be found. |
Returns
| Type | Description |
|---|---|
| double | The time, in seconds, the Keyframe occurs at normal playback speed. |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Animation"] |
Code samples: View on Creator Hub (Animation-GetTimeOfKeyframe).
AnimationTrack:Play
When AnimationTrack:Play() is called the track's animation will begin playing and the weight of the animation will increase from 0 to the specified weight (defaults to 1) over the specified fadeTime.
The speed the AnimationTrack will play at is determined by the speed parameter (defaults to 1). When the speed is equal to 1 the number of seconds the track will take to complete is equal to the track's AnimationTrack.Length property. For example, a speed of 2 will cause the track to play twice as fast.
The weight and speed of the animation can also be changed after the animation has begun playing by using the AnimationTrack:AdjustWeight() and AnimationTrack:AdjustSpeed() methods.
If you want to start the animation at a specific point using AnimationTrack.TimePosition, it's important the animation is played before this is done.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| fadeTime | float | 0.100000001 | The duration of time that the animation's weight should be faded in for. |
| weight | float | 1 | The weight the animation is to be played at. |
| speed | float | 1 | The playback speed of the animation. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| tags | ["CustomLuaState"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Animation"] |
| simulationAccess | true |
Code samples: View on Creator Hub (Animation-Speed-2, Animation-TimePosition).
AnimationTrack:SetParameter
Sets a parameter value on the animation graph, driving animation graph node inputs. Parameters can be set before or during playback. If set before the animation graph has loaded, the value is stored and applied once the graph is ready.
Non-finite numeric values (NaN, Inf) are sanitized to 0 and produce a warning. Use AnimationTrack:GetParameterDefaults() to discover what parameters are available and their default values.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| key | string | The name of the parameter to set. | |
| value | Variant | The value to assign to the parameter. Non-finite numeric values are sanitized to 0. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Animation"] |
| simulationAccess | true |
AnimationTrack:Stop
Stops the AnimationTrack. Once called, the weight of the animation will move towards zero over a length of time specified by the optional fadeTime parameter. For example, if Stop() is called with a fadeTime of 2, it will take two seconds for the weight of the track to reach zero and its effects completely end. Please note this will be the case regardless of the initial weight of the animation.
Usage Notes
After calling Stop(), subsequent calls to Stop() and AdjustWeight() will not work as expected. To adjust a track that's fading out, you must first call Play() to reset the IsPlaying property to true.
It is not recommended to use a fadeTime of 0 in an attempt to override this effect and end the animation immediately for Motor6Ds that have their Motor.MaxVelocity set to zero, as this causes the joints to freeze in place. If it must end immediately, ensure the Motor.MaxVelocity of Motor6Ds in your rig are high enough for them to snap properly.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| fadeTime | float | 0.100000001 | The time, in seconds, for which animation weight is to be faded out over. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| tags | ["CustomLuaState"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Animation"] |
| simulationAccess | true |
Code samples: View on Creator Hub (AnimationTrack-Stop).
Events
| Name | Type / Returns | Description |
|---|---|---|
| AnimationTrack.DidLoop | Fires when an AnimationTrack loops on the next update following the end of the previous animation loop. | |
| AnimationTrack.Ended | Fires when the AnimationTrack is completely done moving anything in the world. | |
| AnimationTrack.KeyframeReached | Fires every time playback of an AnimationTrack reaches a Keyframe that does not have the default name of Keyframe. | |
| AnimationTrack.Stopped | Fires when the AnimationTrack finishes playing. The AnimationTrack might still animate the subject while the animation "fades out". To catch when the AnimationTrack is completely done moving anything in the world, use the AnimationTrack.Ended event. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.AncestryChanged | Fires when the Instance.Parent property of this object or one of its ancestors is changed. | |
| Instance.AttributeChanged | Fires whenever an attribute is changed on the Instance. | |
| Instance.ChildAdded | Fires after an object is parented to this Instance. | |
| Instance.childAdded | ||
| Instance.ChildRemoved | Fires after a child is removed from this Instance. | |
| Instance.DescendantAdded | Fires after a descendant is added to the Instance. | |
| Instance.DescendantRemoving | Fires immediately before a descendant of the Instance is removed. | |
| Instance.Destroying | Fires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy(). | |
| Instance.StyledPropertiesChanged | Fires whenever any style property is changed on the instance, including when a property is set to nil. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.Changed | Fires immediately after a property of the object changes, with some limitations. |
AnimationTrack.DidLoop
This event fires whenever a looped AnimationTrack completes a loop, on the next update.
Currently it may also fire at the exact end of a non looped animation track but this behavior should not be relied upon.
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Animation"] |
Code samples: View on Creator Hub (AnimationTrack-DidLoop).
AnimationTrack.Ended
Fires when the AnimationTrack is completely done moving anything in the world, meaning the animation has finished playing, the "fade out" is finished, and the subject is in a neutral pose.
You can use this to take action when the animation track's subject is back in a neutral pose that's unaffected by the AnimationTrack or to clean up the AnimationTrack.
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Animation"] |
Code samples: View on Creator Hub (AnimationTrack-Ended).
AnimationTrack.KeyframeReached
Deprecated. This event has been superseded by the AnimationTrack:GetMarkerReachedSignal() method.
Fires every time playback of an AnimationTrack reaches a Keyframe that does not have the default name of Keyframe. This event lets you run code at predefined points in an animation (set by Keyframe names).
Keyframe names do not need to be unique. For example, if an animation has three keyframes named Particles, this event will fire each time one of these keyframes is reached.
Keyframe names can be set in the Animation Editor when creating or editing an animation. They cannot however be set by a Script on an existing animation prior to playing it.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| keyframeName | string | The name of the Keyframe reached. |
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Animation"] |
AnimationTrack.Stopped
Fires whenever the AnimationTrack finishes playing.
This event has a number of uses. It can be used to wait until an AnimationTrack has stopped before continuing (for example, if chaining a series of animations to play after each other). It can also be used to clean up any Instances created during the animation playback.
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Animation"] |
Code samples: View on Creator Hub (AnimationTrack-Stopped).