Loading an animation is bringing up a peculiar error

I make a lot of animations, but it has never returned this error message. Studio bug perhaps?

local downedAnim = hum:LoadAnimation(script.Downed)

image

Try changing the animation parent

2 Likes

Should I change it to replicated storage or something?

No, put it in the character. max character

The script and animation are stored in SSS and I’ve never had any issues with it before
i’ll give it a try tho

Okay then show me the entire script please

1 Like

Most of it is irrelevant, but here u go

local isLosingHealth = false

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local hum = character:FindFirstChild("Humanoid")
		
		local playerInfo = Instance.new("Folder")
		playerInfo.Name = "PlayerInfo"
		playerInfo.Parent = player
		
		local downed = Instance.new("BoolValue")
		downed.Parent = player.PlayerInfo
		downed.Name = "Downed"
		
		local stamina = Instance.new("IntValue")
		stamina.Name = "Stamina"
		stamina.Parent = player.PlayerInfo
		
		local downedAnim = hum:LoadAnimation(game.ReplicatedStorage.Animations.Downed) -- start here
		
		hum.HealthChanged:Connect(function()
			if hum.Health <= 15 and isLosingHealth == false then
				isLosingHealth = true
				character:FindFirstChild("Health").Disabled = true
				downed:Play()

				while hum.Health <= 15 and isLosingHealth == true do
					local dt = wait(2)
					hum:TakeDamage(1)
				end

			elseif hum.Health > 15 then
				character:FindFirstChild("Health").Disabled = false
				downed:Stop()
				isLosingHealth = false
			end
		end)
	end)
end)

I just realized what i did wrong sorry everyone

1 Like

Nevermind, but I did catch something that would have broken it
the original error is still a problem

You need to yield for a short period of time between the player joining and the animation being loaded.

task.wait(1) should do the trick.

This is because the AnimationClipProvider service is dynamically loaded during runtime.

Put the animation instance in the character.