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

GetKeyframeSequenceAsync

GetKeyframeSequenceAsync returns a KeyframeSequence based on the specified assetId. The assetId must correspond to an animation. The function will yield until the KeyframeSequence is loaded from the website. Because this is a webcall it should wrapped in a pcall.

Parameters

Name Type Default Description

The content ID of the animation.

Returns

Return Type Summary

The KeyframeSequence found.


Code Samples


KeyframeSequenceProvider:GetKeyframeSequenceAsync

local KeyframeSequence = game:GetService("KeyframeSequenceProvider")
local animation = "rbxassetid://507771019"
local keyframes = {}
local success = pcall(function()
	keyframes = KeyframeSequence:GetKeyframeSequenceAsync(animation)
end)
if success then
	local keyframeTable = keyframes:GetKeyframes()
	for key,value in ipairs(keyframeTable) do
		print("The time of keyframe number",key,"is",value.Time)
	end
else
	print("error getting KeyframeSequence")
end