Animations stop working after player dies

if input.KeyCode == abilitySettings.Abilities[1].key and not debounceWall then
		print(humanoid)
		debounceWall = true
		local earthWallAnimation = animationFolder:FindFirstChild("EarthWallAnimation")
		print(earthWallAnimation, earthWallAnimation.Parent)
		humanoid:LoadAnimation(earthWallAnimation):Play()
		print(humanoid, earthWallAnimation)
		
		earthWallRemote:FireServer()
		
		print("Ability activated:", abilitySettings.Abilities[1].name)
		game:GetService("SoundService"):WaitForChild("EarthWallSound"):Play()
		
		shakeCamera()
		
		wait(abilitySettings.Abilities[1].cooldown)
		debounceWall = false
	end

Okay this is the part of my script that is responsible for the animation, and works so that when the button is pressed, the animation is activated and a request is sent to the server. But the problem is that when I die the animation does not work and accordingly the script itself does not work either. And the console writes this:
Cannot load the AnimationClipProvider Service.

What to do?
I have animation in replicatedStorage, prints I put and got this:
Humanoid
EarthWallAnimation Animations

So here’s what to do

It is possible that the old reference to the humanoid goes to the dead character and not each subsequent ones that are respawned?

Okay, I checked, I did this:

if input.KeyCode == abilitySettings.Abilities[1].key and not debounceWall then -- Проверка нажатия нужной клавиши для EarthWall
		local humanoid = character:WaitForChild("Humanoid")
		print(humanoid)
		debounceWall = true
		local earthWallAnimation = animationFolder:FindFirstChild("EarthWallAnimation")
		print(earthWallAnimation, earthWallAnimation.Parent)
		humanoid:LoadAnimation(earthWallAnimation):Play()
		print(humanoid, earthWallAnimation)
		
		earthWallRemote:FireServer()
		
		print("Ability activated:", abilitySettings.Abilities[1].name)
		game:GetService("SoundService"):WaitForChild("EarthWallSound"):Play()
		
		shakeCamera()
		
		wait(abilitySettings.Abilities[1].cooldown)
		debounceWall = false
	end

But still the problem persisted and nothing changed

I said it still referred to the dead character, not its humanoid only.

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