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

Time

Keyframe

float

This property gives the Keyframe's 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.


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