"Cannot load the AnimationClipProvider Service" error after respawning

Okay normally I almost never have issues debugging and solving my own scripting problems, but this one I physically cannot figure out why it’s happening.

I’m making a simple tool with animiations using the Humanoid.Animator, and it seems to 100% work when i play test the game initially, but after resetting my character and then equipping the tool and loading the animation tracks a second time, I get this error:

image

This is really odd and I cannot for the life of me figure it out.


Some of my attempts to fix this mostly just include of my waiting for the character to fully load, or moving the LoadAnimiation() functions into the equip event, which neither of worked or made a difference.


Here is my code (LocalScript)

local Players = game:GetService("Players")

local Character = Players.LocalPlayer.Character or Players.LocalPlayer.CharacterAdded:Wait()

local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")

local Tool = script.Parent

local Animations = Tool:WaitForChild("Animations")

local UseTrack
local IdleTrack
local EquipTrack

Tool.Equipped:Connect(function()	

	-- Load the animations
	if not UseTrack then
		UseTrack = Animator:LoadAnimation(Animations:WaitForChild("Use"))
		IdleTrack = Animator:LoadAnimation(Animations:WaitForChild("Idle"))
		EquipTrack = Animator:LoadAnimation(Animations:WaitForChild("Equip"))
	end

	EquipTrack:Play()
end)

Tool.Activated:Connect(function()
	if Humanoid.Health > 0 then
		UseTrack:Play()
	end
end)

Tool.Unequipped:Connect(function()
	EquipTrack:Stop()
	IdleTrack:Stop()
	UseTrack:Stop()
end)

I went down a rabbit hole of other people facing the same issue as you, dating back as far as February 2022. A lot of people seemed to have fixed this error message by making sure that whatever is loading the animation is a child of the workspace. So there is two possible options:

Whether these work I do not know for certain, but it is worth an attempt.

Option 1.

...
Tool.Equipped:Connect(function()	

	-- Load the animations
	if not UseTrack then
		Tool.Parent = game.Workspace
		
		UseTrack = Animator:LoadAnimation(Animations:WaitForChild("Use"))
		IdleTrack = Animator:LoadAnimation(Animations:WaitForChild("Idle"))
		EquipTrack = Animator:LoadAnimation(Animations:WaitForChild("Equip"))
		
		Tool.Parent = --<back to original position in the explorer>
	end
...

Option 2.

...
Tool.Parent = game.Workspace

local UseTrack = Animator:LoadAnimation(Animations:WaitForChild("Use"))
local IdleTrack = Animator:LoadAnimation(Animations:WaitForChild("Idle"))
local EquipTrack = Animator:LoadAnimation(Animations:WaitForChild("Equip"))

Tool.Parent = --<back to original position in the explorer>
...
1 Like

Apparently happens if the actor isn’t a descendant of workspace, but don’t worry about it.

It’s cluttering the error logs, but other than that I haven’t noticed anything with it. I don’t think it’s an actual ‘error’.

It is an actual error and completely prevents my animations from playing, and even stops the rest of the code from executing.

None of these solutions seem to solve anything. The tool is always a descendant of workspace when the animations get loaded, and nothing has changed from a typical animated tool.

And also it 100% works when you initially play test, but after respawning and trying to equip the tool, the error occurs. It’s a very unique problem.

These errors shouldn’t be happening in the first place, I have no idea why this is an issue now.

I my self do not have a fix for this, I haven’t even touched this service before but I did find this dev forum post that can hopefully help you out.

This post doesn’t solve the issue sadly. I tried this ‘wait’ based solution, and it doesn’t seem to make a difference at all.

The error still occurs after respawning and equipping the tool, even with a delay.

Well, I cannot help you with this then. If this isn’t resolved when I’m back from school tomorrow then I will do some research. (If I remember.)

1 Like

This is a similar situation of the 'Sanitized ID` bug, which occurred for animations. It shouldn’t happen, but there are hacky ways around the issue.

Make sure it is a direct child of the workspace, not a descendant.

This is speculated and pretty much certain to be a bug, but Roblox has not spoken up about this issue yet.

Has there been an actual bug report yet?

I noticed you have this:

local Character = Players.LocalPlayer.Character or Players.LocalPlayer.CharacterAdded:Wait()

Try this instead:

local Player = Players.LocalPlayer
local Character = Player.Character
if not (Character and Character.Parent then
    Character = Player.CharacterAdded:Wait()
end

You need to check if the character is not the dead previous character that has been destroyed. LoadAnimation will fail if you try to load animations on one of these ‘dead’ characters.

I used to have the exact same problem and this was the solution.

it shouldn’t affect my code at all, since the local script is in a tool and updates whenever i respawn, it shouldn’t do that.

I’ll try it anyways

1 Like

Not sure when the code actually runs (I forgot how tool’s LocalScripts behave), is the problem possibly that these lines need to be re-run? I would try reseting these variables the function connected to Equipped just to see if that fixes it.

2 Likes

Okay that actually fixed it… I was so confused. Thanks heaps!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.