Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Keyframe

A Keyframe holds the Poses applied to joints in a Model at a given point of time in an animation. Keyframes are interpolated between during animation playback.

Member index 7

HistoryMember
553Time: float
573AddMarker(marker: Instance): null
573AddPose(pose: Instance): null
648GetMarkers(): Instances
648GetPoses(): Instances
573RemoveMarker(marker: Instance): null
573RemovePose(pose: Instance): null
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

A Keyframe holds the Poses applied to joints in a Model at a given point of time in an animation. Keyframes are interpolated between during animation playback.

Note, in most cases developers do not need to manipulate KeyframeSequences as the animation editor covers most animation functionality. However, in some cases a developer may wish to generate an animation from a Script or build their own plugin.

Structure

Keyframes are held within a KeyframeSequence and contain Pose objects. The poses are named in accordance with the BaseParts they correspond to and are structured in terms of joint hierarchy. This means each Pose is parented to the Pose corresponding to the part it is attached to.

Note, as Poses are named in accordance with the BaseParts they correspond to, animations require distinct part names to play correctly.

Interpolation

During animation playback the poses in different keyframes are interpolated between. This allows a smooth animation to be created without needing to define every frame. Note, the style of interpolation is determined in the Pose object. The Keyframe object merely holds the Poses at a defined point of time in the animation (Keyframe.Time).

History 24

Members 7

AddMarker

Parameters (1)
markerInstance
Returns (1)
null

This function adds a KeyframeMarker to the Keyframe by parenting it to the keyframe. It is functionally identical to setting the marker's Instance.Parent to the Keyframe.

Note, this function will not error when an instance other than a KeyframeMarker is given as the parameter and will parent it successfully.

More about Keyframes

Keyframe names do not need to be unique. For example, if an Animation has three keyframes named "Particles" the connected event returned by AnimationTrack:GetMarkerReachedSignal() will fire each time one of these keyframes is reached.

Keyframe names can be set in the Roblox Animation Editor when creating or editing an animation. They cannot however be set by a Script on an existing animation prior to playing it.

See also:

History 3

AddPose

Parameters (1)
poseInstance
Returns (1)
null

This function adds a Pose to the Keyframe by parenting it to the keyframe. It is functionally identical to setting the pose's Instance.Parent to the keyframe.

Note, this function will not error when an instance other than a Pose is given as the pose parameter and will parent it successfully.

History 3

GetMarkers

Parameters (0)
No parameters.
Returns (1)
Instances

This function returns an array containing all KeyframeMarkers that have been added to the Keyframe. Note, this function will only return instances of type KeyframeMarker.

More about Keyframes

Keyframe names do not need to be unique. For example, if an Animation has three keyframes named "Particles" the connected event returned by AnimationTrack:GetMarkerReachedSignal() will fire each time one of these keyframes is reached.

Keyframe names can be set in the Roblox Animation Editor when creating or editing an animation. They cannot however be set by a Script on an existing animation prior to playing it.

See also:

History 3

GetPoses

Parameters (0)
No parameters.
Returns (1)
Instances

This function returns an array containing all Poses that have been added to a Keyframe.

History 3

RemoveMarker

Parameters (1)
markerInstance
Returns (1)
null

This function removes a KeyframeMarker from the Keyframe by settings its Instance.Parent to nil.

The KeyframeMarker's Instance.Parent is set to nil but it is not destroyed. This means, provided the marker is referenced it can be re-parented later.

Note, this function will not error when an instance other than a KeyframeMarker is given as the parameter.

More about Keyframes

Keyframe names do not need to be unique. For example, if an Animation has three keyframes named "Particles" the connected event returned by AnimationTrack:GetMarkerReachedSignal() will fire each time one of these keyframes is reached.

Keyframe names can be set in the Roblox Animation Editor when creating or editing an animation. They cannot however be set by a Script on an existing animation prior to playing it.

See also:

History 3

RemovePose

Parameters (1)
poseInstance
Returns (1)
null

This function removes a Pose from the Keyframe by setting its Instance.Parent to nil without destroying it. This means the provided the pose is referenced and it can be re-parented later.

Note, this function will not error when an instance other than a Pose is given as the pose parameter.

History 3

Time

TypeDefault
float0

This property gives the Keyframe time position (in seconds) in an animation. This determines the time at which the Poses inside the keyframe will be shown.

Note the Keyframe with the highest time value in a KeyframeSequence is used to determine the length of the animation.

History 4

  • 553 Change Default of Time from to 0
  • 486 Change ThreadSafety of Time from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of Time from to ReadOnly
  • 47 Add Time

Settings