Learn
Engine Class
KeyframeSequence

Summary
Methods
AddKeyframe(keyframe: Instance):()
RemoveKeyframe(keyframe: Instance):()
Inherited Members
Code Samples
Get KeyframeSequence Length
local function getSequenceLength(keyframeSequence)
local length = 0
for _, keyframe in pairs(keyframeSequence:GetKeyframes()) do
if keyframe.Time > length then
length = keyframe.Time
end
end
return length
end
local keyframeSequence = Instance.new("KeyframeSequence")
getSequenceLength(keyframeSequence)
KeyframeSequence Instantiation
-- Create the sequence
local keyframeSequence = Instance.new("KeyframeSequence")
keyframeSequence.Loop = false
keyframeSequence.Priority = Enum.AnimationPriority.Action
-- Create a keyframe
local keyframe = Instance.new("Keyframe")
keyframe.Time = 0
-- Create sample poses
local rootPose = Instance.new("Pose")
rootPose.Name = "HumanoidRootPart"
rootPose.Weight = 0
local lowerTorsoPose = Instance.new("Pose")
lowerTorsoPose.Name = "LowerTorso"
lowerTorsoPose.Weight = 1
-- Set the sequence hierarchy
rootPose:AddSubPose(lowerTorsoPose)
keyframe:AddPose(rootPose)
keyframeSequence:AddKeyframe(keyframe)
-- Parent the sequence
keyframeSequence.Parent = workspace

API Reference
Properties
AuthoredHipHeight
Hidden
Plugin Security
Read Parallel
Capabilities: Animation
KeyframeSequence.AuthoredHipHeight:number

Methods
AddKeyframe
Capabilities: Animation
KeyframeSequence:AddKeyframe(keyframe:Instance):()
Parameters
keyframe:Instance
Returns
()
Code Samples
KeyframeSequence Instantiation
-- Create the sequence
local keyframeSequence = Instance.new("KeyframeSequence")
keyframeSequence.Loop = false
keyframeSequence.Priority = Enum.AnimationPriority.Action
-- Create a keyframe
local keyframe = Instance.new("Keyframe")
keyframe.Time = 0
-- Create sample poses
local rootPose = Instance.new("Pose")
rootPose.Name = "HumanoidRootPart"
rootPose.Weight = 0
local lowerTorsoPose = Instance.new("Pose")
lowerTorsoPose.Name = "LowerTorso"
lowerTorsoPose.Weight = 1
-- Set the sequence hierarchy
rootPose:AddSubPose(lowerTorsoPose)
keyframe:AddPose(rootPose)
keyframeSequence:AddKeyframe(keyframe)
-- Parent the sequence
keyframeSequence.Parent = workspace

GetKeyframes
Capabilities: Animation
KeyframeSequence:GetKeyframes():{Keyframe}
Returns
Code Samples
Get KeyframeSequence Length
local function getSequenceLength(keyframeSequence)
local length = 0
for _, keyframe in pairs(keyframeSequence:GetKeyframes()) do
if keyframe.Time > length then
length = keyframe.Time
end
end
return length
end
local keyframeSequence = Instance.new("KeyframeSequence")
getSequenceLength(keyframeSequence)

RemoveKeyframe
Capabilities: Animation
KeyframeSequence:RemoveKeyframe(keyframe:Instance):()
Parameters
keyframe:Instance
Returns
()
Code Samples
KeyframeSequence RemoveKeyframe
local keyframeSequence = Instance.new("KeyframeSequence")
keyframeSequence.Parent = workspace
local keyframe = Instance.new("Keyframe")
keyframeSequence:AddKeyframe(keyframe)
task.wait(2)
keyframeSequence:RemoveKeyframe(keyframe)

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.