Error - Cannot load the AnimationClipProvider service

For anyone facing this problem, it’s typically caused by attempting to load an animation before the AnimationClipProvider service has loaded itself (it’s loaded by CoreScripts), to circumvent this issue you can add a small yield (delay) between the script’s execution starting and the animation loading, i.e;

local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
if not player:HasAppearanceLoaded() then player.CharacterAppearanceLoaded:Wait() end
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local animation = script:WaitForChild("Animation") --Animation placed inside script.
task.wait() --Yield here, increase delay if necessary.
local track = animator:LoadAnimation(animation)
repeat task.wait() until track.Length > 0
track:Play()
12 Likes

While using Studios multiple Clients and Servers Test feature It gave me the same error for every test client that joined. The error was limited to server scripts only so the animations played by test clients were working and i don’t think the issue happened because the server script executed before AnimationClipProvider service has loaded since resetting the test client character gave the same error again
unknown (10)

2 Likes

This is true, this is also caused if you try to apply animations onto things currently located in replicatedstorage or in an inanimate service ^

3 Likes

im currently having this issue, anyone else?

3 Likes

put wait() on first line.
trust me.

28 Likes

print(“THANK U THANK YOOYYOYUUUYUUYUYYUUYUYUYUYU”);

3 Likes

To solve the problem, type this before loading the animations:

repeat
        task.wait(1)
until humanoid.Parent.Parent == workspace

the reason of the error is trying to load the animations on the character before it is fully loaded in the workspace, hope this helped.

2 Likes
repeat task.wait(1) until humanoid.Parent.Parent == workspace

also works and saves 2 lines

4 Likes
while humanoid.Parent.Parent ~= workspace do
        task.wait(1)
end

will not make it work.
the reason your code make them work is it must makes all the code wait.
just… what code need is wait() .

4 Likes

This error also happens to me and this was the solution I found:
Put this before the character variable

Player.CharacterAppearanceLoaded:Wait()

1 Like

What? His code does work, however, as it’s a repeat loop, the code will run and the condition later, a while loops runs the condition first.

Also, don’t use ~= workspace or == workspace, since you may use custom character parent (like a folder)

Instead do:

while char.Parent == nil do
       task.wait()
end
1 Like

OH MY GOD THANK YOU

while task.wait (0.01) do
warn("THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU")

end

Hey roblox, i’m looking at you. Please fix this bug.

2 Likes

press like(heart shape) button for me :wink:

13 Likes

Okay so I found a solution to this, however it might not be one for a lot of you guys (I used Promise.lua)

--// My Util Module

local myUtil = {}

local function loadAnimation(hum, anim)
	return Promise.new(function(resolve, reject)
		local animTrack;

		local success, output = pcall(function()
			animTrack = hum:LoadAnimation(anim)
		end)	

		if not success then
			reject()
		else
			resolve(animTrack)
		end
	end)
end

function myUtil:fetchAnimTrack(hum,anim)
	return Promise.retryWithDelay(
		loadAnimation, 5, 1,
		hum, anim
	):expect()
end

return myUtil

This function safely loads any AnimationTracks and returns them.

Just run:

myUtil:fetchAnimTrack(someHumanoid, someAnimationInstance)
9 Likes

This is the solution, thanks! I hope the post author marks your answer. What I did was I made sure to parent my npc to workspace before loading animations!

I had this problem for a while this solved everything thank you so much

1 Like

You need to parent the button before loading the animation

Wanted to add my tuppence while this is still considered current.

I have found it necessary to wait a small time after player.CharacterAdded:Connect(onCharacterAdded) fires.

I don’t actually call wait or task.wait, which is generally frowned upon, not that would stop me. Instead I add accessories (just my hat) which seems to impart all the delay I need. Here are my timings:

  23:30:54.818  too soon to `animator:LoadAnimation(animation)`
  23:30:55.114  1772336109 Enum.AccessoryType.Hat
  23:30:55.428  not too soon to `animator:LoadAnimation(animation)`

So yeah, I’m effectively waiting some arbitrary time of about 0.5s, which is bad practice, but it works so why complain?

The elaborate solutions above look nice, but there is nothing specifically to wait for, in either case (both too soon and not too soon):

print(player.Character.Humanoid.Parent.Parent)

returned nil. Which I don’t understand because:

player.Character.Humanoid.Parent.Parent == player.Character.Parent == player

Nothing is impossible, or completely broken, my last answer got me thinking. We do have something to wait for; the success of the call itself.

In lua we handle exceptions using pcall. The canonical solution is therefore:

function safelyLoadTrack(animator: Animator, animation: Animation): AnimationTrack
    local success, errorOrData
    repeat
        success, errorOrData = pcall(function()
            return animator:LoadAnimation(animation)
        end)
        if not success then
            warn(errorOrData) -- We're calling it too early but ideally we'd check that with this error message, which we can at least preserve verbatim.
            task.wait(0.2)
        end
    until success
	return errorOrData
end

A word of caution on exception handling, don’t ignore errors. Ideally we’d test the errorOrData message is what we expect, and not something pertaining to a non-existant, or bad, animation, or the servers being down.

The error message I expect is:

Cannot load the AnimationClipProvider Service.

but that isn’t formally specified nor guaranteed not to change with future updates.

2 Likes

for me personally the fix wasnt any waits or nothing it was simply the fact i played 2 same animations at the same time that caused the error for me, i had an ancestry changed event connected to an instance that was parented to the character, which after its deleted, plays an animation, i also had a play animation on respawn, since my respawn time was low it was pretty much instant so both (same animations) tried to play vs each other giving me the error, after adding a health>0 check in my ancestry event the error is gone maybe someone has this exact problem if so theres ur fix