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

RegisterActiveKeyframeSequence

Generates a temporary asset ID from a KeyframeSequence that can be used for localized testing of an animation.

This function performs the same function to KeyframeSequenceProvider/RegisterKeyframeSequence however this function generates an active:// URL instead of a hash.

The ID generated can be used in an Animation's Animation/AnimationId property for testing.

The asset ID generated by this function is temporary and cannot be used outside of Studio. Developers wishing to generate an asset ID that can be used online should upload the KeyframeSequence to Roblox.

Parameters

Name Type Default Description

The KeyframeSequence to be used.

Returns

Return Type Summary

A temporary asset ID generated for localized animation playback.


Code Samples


Create temporary animation

This code sample contains a simple function to generate an Animation with a generated hash ID to preview a KeyframeSequence locally.

    local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
    
    local function createPreviewAnimation(keyframeSequence)
    	local hashId = KeyframeSequenceProvider:RegisterKeyframeSequence(keyframeSequence) 
    	if hashId then 
    		local Animation = Instance.new("Animation")
    		Animation.AnimationId = hashId
    		return Animation
    	end
    end