Cannot load the AnimationClipProvider Service on Characters issue

  1. What do you want to achieve? Fix my error.

  2. What is the issue? So, basically, i have a script that should clone and load the characters in a viewport frame (which works fine), but when i add a script that should load an animation i get the error: Cannot load the AnimationClipProvider Service.

  3. What solutions have you tried so far? Devforum

Info: The animationId the character will get are random and the characters are made in a folder in replicatedStorage.

The block of script:

	local purchaseTemplate = shopFrame.CharacterInspect

	local name = shopFolder.Name
	local rarity = shopFolder.Rarity
	
	local camera = Instance.new("Camera", template.ViewportFrame)
	template.ViewportFrame.CurrentCamera = camera

	local characterModel = game.ReplicatedStorage.Characters[name]:Clone()
	characterModel.Parent = template.ViewportFrame
	
	local animIndex = math.random(1, #setting.CharacterPoseAnimations)
	local chosenAnimId = setting.CharacterPoseAnimations[animIndex]

	local newAnim = Instance.new("Animation")
	newAnim.AnimationId = "rbxassetid://"..chosenAnimId
	
	print(characterModel.Name.." "..newAnim.AnimationId.." "..characterModel.Humanoid.Name)
	
	local animTrack = characterModel:WaitForChild("Humanoid"):LoadAnimation(newAnim)
	animTrack:Play()
	
	local hrp = characterModel.PrimaryPart
	camera.CFrame = CFrame.new(hrp.Position + hrp.CFrame.LookVector * 3, hrp.Position)

I do not want someone making a script for me. I just need to find what’s the issue and how to fix it. Thanks!

I believe you need to use WorldModels to animate inside of a ViewportFrame. I am unsure how to use them so you will have to read the documentation.