Cannot load the AnimationClipProvider Service

Hello, so, I cannot play animations within ViewportFrames, I have seen many of these before but no solutions work, or maybe I am doing it wrong.

However, I need help for a shop system, here is the current script:

for i, v in pairs(game.ReplicatedStorage.Emotes:GetChildren()) do
	local frame
	if v:FindFirstChild("CoinPrice") then
		frame = script.CoinTemplate:Clone()
		frame.Price.Text = v.CoinPrice.Value
	elseif v:FindFirstChild("GemsPrice") then
		frame = script.GemsTemplate:Clone()
		frame.Price.Text = v.GemsPrice.Value
	else
		return
	end
	
	frame.ViewportFrame.EmoteGuy.Humanoid.Animator:LoadAnimation(frame.ViewportFrame.EmoteGuy:FindFirstChild(v.Name)):Play()
	frame.Name = v.Name
	frame.Parent = script.Parent
	
	frame.MouseButton1Click:Connect(function()
		script.Parent.Parent.PurchaseConfirm.Visible = true
		script.Parent.Parent.PurchaseConfirm.ViewportFrame.EmoteGuy.Humanoid.Animator:LoadAnimation(script.Parent.Parent.PurchaseConfirm.ViewportFrame.EmoteGuy:FindFirstChild(v.Name)):Play()
		script.Parent.Parent.PurchaseConfirm.TextLabel.Text = frame.Name
	end)
end

Can anyone help? It would be appreciated.

I think you need to parent your character before calling Animator:LoadAnimation on it.

	for i, v in pairs(game.ReplicatedStorage.Emotes:GetChildren()) do
		local frame
		if v:FindFirstChild("CoinPrice") then
			frame = script.CoinTemplate:Clone()
			frame.Price.Text = v.CoinPrice.Value
		elseif v:FindFirstChild("GemsPrice") then
			frame = script.GemsTemplate:Clone()
			frame.Price.Text = v.GemsPrice.Value
		else
			return
		end
		
		frame.Name = v.Name
		frame.Parent = script.Parent
		
		frame.ViewportFrame.EmoteGuy.Humanoid.Animator:LoadAnimation(frame.ViewportFrame.EmoteGuy:FindFirstChild(v.Name)):Play()

		frame.MouseButton1Click:Connect(function()
			script.Parent.Parent.PurchaseConfirm.Visible = true
			script.Parent.Parent.PurchaseConfirm.ViewportFrame.EmoteGuy.Humanoid.Animator:LoadAnimation(script.Parent.Parent.PurchaseConfirm.ViewportFrame.EmoteGuy:FindFirstChild(v.Name)):Play()
			script.Parent.Parent.PurchaseConfirm.TextLabel.Text = frame.Name
		end)
	end

Nope, that didnt work, even changing the script entirely:
here is what it is now

for i, v in pairs(game.ReplicatedStorage.Emotes:GetChildren()) do
	local frame
	if v:FindFirstChild("CoinPrice") then
		frame = script.CoinTemplate:Clone()
		frame.Price.Text = v.CoinPrice.Value
	elseif v:FindFirstChild("GemsPrice") then
		frame = script.GemsTemplate:Clone()
		frame.Price.Text = v.GemsPrice.Value
	else
		
	end
	
	
	frame.Name = v.Name
	frame.Parent = script.Parent

	local cloned = v:Clone()
	cloned.Parent = frame.ViewportFrame
	for i, x in pairs(cloned:GetChildren()) do
		if x:IsA("Animation") then
			v.Humanoid.Animator:LoadAnimation(x):Play()
		end
	end
	

	frame.MouseButton1Click:Connect(function()
		script.Parent.Parent.PurchaseConfirm.Visible = true
		script.Parent.Parent.PurchaseConfirm.TextLabel.Text = frame.Name
	end)
end

you gotta waitforchild the humanoid / animator

nope nothing works, however i will keep note of anything i need to

Fixed it! It is complicated but I did it!

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