Failed to load animation?

So I’m trying to fix a little raking script but this “Animation failed to load” error makes it way harder.
The animation is owned by the group and the game is owned by the same group.
Here’s the code.

script.Parent.ChildAdded:Connect(function(LP)
	LP.Click.MouseClick:Connect(function(plr)
		if plr.Character:FindFirstChild("Rake") and plr:FindFirstChild("RakeQuest") and (plr.Character.HumanoidRootPart.Position - LP.Position).magnitude < 10 and not table.find(LazySarinFix, LP) then
			plr.Character.HumanoidRootPart.Anchored = true
			table.insert(LazySarinFix, LP) 
			spawn(function()
				wait(1)
				table.remove(LazySarinFix, table.find(LazySarinFix, LP))
			end)
			--LP.RakeSound:Play()
			
			
			local Anim = Instance.new("Animation", plr.Character)
			Anim.AnimationId = "rbxassetid://5925545595"
			
			local Loaded = plr.Character.Humanoid.Animator:LoadAnimation(Anim)
			Loaded:Play()
			wait(4.8)
			
			Loaded:Stop()
			
				--LP.RakeSound:Stop()
			
			
			plr.Character.HumanoidRootPart.Anchored = false
			plr.RakeQuest.Value += 1
			local LPClone = LP:Clone()
			LPClone.Parent = game:GetService("ServerStorage")
			LPClone.CFrame = LP.CFrame * CFrame.new(math.random(-35, 35)/10, 0, math.random(-35, 35)/10)
			LP:Destroy()
			wait(2)
			LPClone.Parent = script.Parent
		end
	end)
end

There was a sudden change earlier:

You can see in the code that I am not using the humanoid load animation and that I am directly using the animator.

Any of these cases are similar?

1 Like

Yes, especially the second one.

Attempt this solution:

Otherwise, there’s something else that I must have overlooked. Might be the animation itself. Check if that asset is not moderated or under review.

Well my script doesn’t have an endless wait so I don’t know why it doesn’t play.
The animation doesn’t seem to be under review because my plugin (BTRoblox) is able to preview it.
And as I said the animation is uploaded to the group.

How’s the error written exactly if I may ask?

18:57:24.604 - Animation "https://assetdelivery.roblox.com/v1/asset?id=5925545595&serverplaceid=0" failed to load in "Workspace.elprsn.Animation.AnimationId": Animation failed to load

Okay so the animation works but only in game. It doesn’t work in the studio for some reason.

I suspected that the asset sometimes fail to function in Studio but not in-game. I don’t have any explanation for that, but my suggestion is a Studio bug.

I had the same issue. I discovered that it’s because the game runs under your profile in Studio. If the animations are on the group, they won’t load for you. They’ll only work on a published game as the Creator is correctly set as the group rather than the tester themselves.