Loading the animation onto the animator doesn't work

Hey, why doesn’t this load my animation onto the animator? It’s giving an error message: Cannot load the AnimationClipProvider Service.

local anims = {
    11833632184,
    11851590744
} 

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local humanoid = character:WaitForChild("Humanoid")
        local animator = humanoid:WaitForChild("Animator")

        for _, v in anims do
            local anim = Instance.new('Animation')
            anim.AnimationId = 'rbxasset://'..v

            animator:LoadAnimation(anim)

            task.wait()
        end
    end)
end)

Hard to Identify without more context, however, it would be easier to identify the problem by wrapping the creation of the animation in a pcall function to see if it errors.

im not sure why exactly this works. my guess is that youre trying to load the animations too quickly when the character joins, and it gives you the error. before the for loop, you should wait 2 seconds beforehand. i tested it out and it worked for me, lemme know how that goes.

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