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

GetKeyframes

This function returns an array containing all Keyframes that have been added to a KeyframeSequence. This is functionally the same as using the Instance/GetChildren function on the KeyframeSequence.

Note, this function will return all children of the KeyframeSequence, including non Keyframes if any are present.

Returns

Return Type Summary

An array of Keyframes


Code Samples


Get KeyframeSequence Length

This sample contains a simple function that will get the length of a KeyframeSequence by finding the Keyframe with the highest Keyframe.Time value.

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