Cannot load the AnimationClipProvider Service

Hi, so when I die with a tool it just give me the “Cannot load the AnimationClipProvider Service” stare when I respawn

I’ve been trying to fix this error by myself for several hours now and it still does not work, I think I need a hand here…

I DID unset the player when the character died. Here’s the script

local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
repeat wait() until Humanoid
local animator = Humanoid:WaitForChild("Animator")
repeat wait() until animator

local idleanim = script.Parent.Animations:WaitForChild("Idle")
local fireanim = script.Parent.Animations:WaitForChild("Fire")
local reloadanim = script.Parent.Animations:WaitForChild("Reload")

local loadidle = animator:LoadAnimation(idleanim) loadidle:Play()  loadidle:Stop()
local loadfire = animator:LoadAnimation(fireanim) loadfire:Play() loadfire:Stop()
local loadreload = animator:LoadAnimation(reloadanim) loadreload:Play() loadreload:Stop()

tool.Equipped:Connect(function()
	local NewGunUI = tool.GunUI:Clone()
	NewGunUI.Parent = Player.PlayerGui
	NewGunUI.GunName.Text = tool.Name
	NewGunUI.Counter.Text = CurrentAmmo.."/"..ReserveAmmo
	GunUI = NewGunUI
	equipped = true
	canfire = true
	reloading = false
	holdingfire = false
	loadidle:Play(0,1,1)
end)

tool.Unequipped:Connect(function()
	if GunUI then
		GunUI:Destroy()
		GunUI = nil
	end
	holdingfire = false
	equipped = false
	reloading = false
	canfire = false
	for _, animation in ipairs(allanimations) do
		animation:Stop()
	end
end)

Humanoid.Died:Connect(function()
	if GunUI then
		GunUI:Destroy()
		GunUI = nil
	end
	holdingfire = false
	equipped = false
	reloading = false
	canfire = false
	for _, animation in ipairs(allanimations) do
		animation:Stop()
	end
end)

The error happens at this line

local loadidle = animator:LoadAnimation(idleanim) loadidle:Play()  loadidle:Stop()

Any help would be great, thanks!

2 Likes

I have been experiencing the same issue for a few days now as well, I believe this would be a ROBLOX issue that they need to resolve. If you do find a way to fix it, do share! However in the meantime try to use other methods of loading an animation too.

2 Likes

“other methods of loading an animation”? what are the other methods? do you mean using the humanoid to load the animation?

1 Like
  1. You could try replacing:
for _, animation in ipairs(allanimations) do

animation:Stop()

end

With:

for _, animation in ipairs(animator:GetPlayingAnimationTracks())

animation:Stop()

end
  1. Where is this script placed?

Inside of the tool itself, qqqqqqqq

That doesnt work, it also stops core animations

Guess i’ll have to do more research to find a stop to this issue.

Is the error halting any of the code itself?

Well it stops my gun from firing, but on other tool that has the same problem it seems to work fine but just without animations

Maybe you could try loading the animation once the tool is equipped?

Tried that aswell, didnt work qq

Why do the animations use :Play and :Stop in the same line?

cause I want to load them when the player spawns in so there’s no delay when loading them for the first time

It does work tho, but like I said on the topic when I respawn it returns “Cannot load the AnimationClipProvider Service” and I don’t think it’s that line’s fault

You could try this:

Humanoid.Died:Connect(function()
	if GunUI then
		GunUI:Destroy()
		GunUI = nil
	end
	holdingfire = false
	equipped = false
	reloading = false
	canfire = false
	for _, animation in ipairs(allanimations) do
		animation:Stop()
	end

task.wait(game:GetService("Players").RespawnTime + .25)

loadidle = animator:LoadAnimation(idleanim) loadidle:Play()  loadidle:Stop()
loadfire = animator:LoadAnimation(fireanim) loadfire:Play() loadfire:Stop()
loadreload = animator:LoadAnimation(reloadanim) loadreload:Play() loadreload:Stop()

end)

It still doesnt work. do you know what might be causing the AnimationClipProvider error in the first place? (can’t get animation, can’t get character, etc.)

Could i see how the instance hierarchy looks? (the layout of the tool’s children.)

here you go
image

  1. Try checking where if the animations are still in the players backpack after they die. (Players > “Player’s Name” > Backpack)

  2. Maybe try placing the animations into ReplicatedStorage and referencing them there.

perhaps I can do

repeat
	wait()
until tool:FindFirstChild("Animations")

?

You could try:

repeat
	wait()
until Player.Backpack[“Tool Name”]:FindFirstChild("Animations")

ok, so i checked. I basically did this:

if animator and idleanim then
	loadidle = animator:LoadAnimation(idleanim)
elseif not animator then
	print("Cant get animator")
elseif not idleanim then
	print("Cant get animation")
else
	print("Unknown")
end

So basically roblox just couldn’t load it for some reason because it didnt return anything but the animationclipprovider error