KeyframeSequence
This object stores all of the Keyframes and other data for the animation.
Memory category | Animation |
---|
Member index 4
Removed member index 2
History | Member | |
---|---|---|
497 | Loop: bool | |
497 | Priority: AnimationPriority |
Description
KeyframeSequence stores all the Keyframes for an Animation, determines if the animation will Loop, and determines its Priority against other animations. The last Keyframe in the sequence, meaning the Keyframe with the highest Time property, determines the length of an animation.
Although Priority and Loop save the priority and looped animation settings for the sequence, note that AnimationTrack properties can eventually overwrite these properties at playback time.
If you want to preview an Animation before uploading it to Roblox, you can generate a temporary hash ID using KeyframeSequenceProvider:RegisterKeyframeSequence() for localized animation testing.
Obtaining Sequences
In some cases you may wish to download the KeyframeSequence corresponding to an existing uploaded Animation. You can use AnimationClipProvider:GetAnimationClipAsync() to download an animation.
History 24
- 648 Change ReturnType of GetKeyframes from Objects to Instances
- 573 Change ReturnType of RemoveKeyframe from void to null
- 573 Change ReturnType of AddKeyframe from void to null
- 553 Change Default of from to 2
- 497 Remove Priority
- 497 Remove Loop
- 497 Change Superclass of KeyframeSequence from Instance to AnimationClip
- 486 Change ThreadSafety of Priority from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Loop from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 469 Change Tags of from [] to [Hidden]
- 462 Change ThreadSafety of RemoveKeyframe from to Unsafe
- 462 Change ThreadSafety of GetKeyframes from to Unsafe
- 462 Change ThreadSafety of AddKeyframe from to Unsafe
- 462 Change ThreadSafety of Priority from to ReadOnly
- 462 Change ThreadSafety of Loop from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 364 Add
- 47 Add RemoveKeyframe
- 47 Add GetKeyframes
- 47 Add AddKeyframe
- 47 Add Priority
- 47 Add Loop
- 47 Add KeyframeSequence
Members 4
AddKeyframe
Parameters (1) | ||
---|---|---|
keyframe | Instance | |
Returns (1) | ||
null |
This method adds a Keyframe to the KeyframeSequence by parenting it to the KeyframeSequence. It is functionally identical to setting the keyframe's Instance.Parent to the KeyframeSequence.
Note that this method will not error when called with an instance other than
a Keyframe as the keyframe
parameter and will parent it
successfully.
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of AddKeyframe from void to null
- 462 Change ThreadSafety of AddKeyframe from to Unsafe
- 47 Add AddKeyframe
GetKeyframes
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Instances |
This method returns an array that contains all Keyframes that have been added to a KeyframeSequence.
Thread safety | Unsafe |
---|
History 3
- 648 Change ReturnType of GetKeyframes from Objects to Instances
- 462 Change ThreadSafety of GetKeyframes from to Unsafe
- 47 Add GetKeyframes
RemoveKeyframe
Parameters (1) | ||
---|---|---|
keyframe | Instance | |
Returns (1) | ||
null |
This method removes a Keyframe from the KeyframeSequence
by setting its parent to nil
. It is functionally identical to setting
the keyframe's parent to nil
.
Note that while this sets the keyframe's parent to nil
, it does not destroy it. Provided another reference to the keyframe remains, it can be
re-parented later.
Also note that this method will not error when called with an Instance other than a Keyframe as the keyframe parameter.
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of RemoveKeyframe from void to null
- 462 Change ThreadSafety of RemoveKeyframe from to Unsafe
- 47 Add RemoveKeyframe
Removed members 2
Loop
Type | Default | |
---|---|---|
bool |
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
Priority
Type | Default | |
---|---|---|
AnimationPriority |
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |