How to use AnimationClipProvider?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to use the AnimationClipProvider to create temporary animation IDs for my animations. This is so that I can continue working on them without having to republish them, cluttering up my animations folder in my developer assets.

  2. What is the issue? Include screenshots / videos if possible!
    I am using a script (shown below) to iterate through all the animations within RBX_ANIMSAVES and assign each one a temporary AnimationId, before creating an attribute with the animation’s name and Id as its value for any server script to access (all animations will be run on the server). The script uses recursion (the function calling itself) so can be a bit difficult to understand, but I don’t see what’s going wrong.

  3. What solutions have you tried so far? Searching online and in the DevForum. The documentation for AnimationClipProvider wasn’t very helpful either.

Here’s the script. It’s placed within ServerScriptService. The output tab also doesn’t seem to show anything pertaining to this script.

local AnimSaves = game.ServerStorage:WaitForChild("RBX_ANIMSAVES")
local Provider = game:GetService("AnimationClipProvider")

local function ConvertKeyframes(root)
	if root:IsA("KeyframeSequence") then
		script:SetAttribute(root.name, Provider:RegisterAnimationClip(root))
	else
		for _, child in ipairs(root:GetChildren()) do
			ConvertKeyframes(child)
		end
	end
end

ConvertKeyframes(AnimSaves)

If anyone has an idea as to why this isn’t working, please do reply, I have no idea why this could be.
Also, this is the first topic I’ve created on the forums. If I’ve done anything wrong, do please say.

If you want to update / keep working on the same animations without re-publishing them, you should use the “Overwrite an Existing Asset” button in the lower left corner of the publish window. You can then publish the updated animation to the same asset id.

However, If you must use temporary ids from AnimationClipProvider, can you share exactly what is going wrong with your script and can you share how your RBX_ANIMSAVES looks in explorer?

Remember that in order to play the animation, you would have to use an Animation instance like so:

local anim = Instance.new("Animation")
anim.AnimationId = script:GetAttribute("AnimationName")

local track = someHumanoid.Animator:LoadAnimation(anim)
track:Play()

Thanks for telling me about being able to overwrite previous assets, that’s quite useful. As for the explorer layout, here it is:


When I press play, I switch to server mode (so I can access ServerScriptService) and click on the KeyframeHandler script. No attributes are shown. In the output, nothing indicates why the script isn’t working.
Edit: there’s one rig with animations at the moment, but there’ll probably be more so that I can organise the different sets of animations. This is why the recursion feature is useful.