Cannot load the AnimationClipProvider issue

when my character died, the animation provider has a issue

local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid:: Humanoid
local animator = humanoid.Animator:: Animaton

local Animation = {}

function Animation:playAnimation(animation: Animation, waitAnimationCompleted: boolean?)
	if not character then return end
	
	local animationTrack = animator:LoadAnimation(animation):: AnimationTrack
	animationTrack.Priority = Enum.AnimationPriority.Action

	animationTrack:Play()

	if waitAnimationCompleted then
		animationTrack.Stopped:Wait()
		animationTrack:Stop()
	end

	return animationTrack
end

return Animation

1 Like

You’ll need to check if humanoid health is below 0 and if character.Parent isn’t nil

1 Like