I was trying to remove loadedanimations from the humanoid but i don’t know how. I tried using :Destroy() on the instance but it didn’t seem to work and for some reason when i use .Stopped:wait() on the animationtrack it wouldn’t show this error anymore
Scripts i used:
Script1
local Loaaaadanimation
for i = 0,300,1 do
local humanoid = script.Parent:WaitForChild("Humanoid")
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://5718899990"
Animation.Parent = script.Parent
Loaaaadanimation = humanoid:LoadAnimation(Animation)
Animation:Destroy()
Loadanimation:Play()
Loadanimation:Destroy()
end
Script2
local Loaaaadanimation
for i = 0,300,1 do
local humanoid = script.Parent:WaitForChild("Humanoid")
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://5718899990"
Animation.Parent = script.Parent
Loaaaadanimation = humanoid:LoadAnimation(Animation)
Animation:Destroy()
Loaaaadanimation:Play()
Loaaaadanimation:AdjustSpeed(1234123412341234)
Loaaaadanimation.Stopped:wait()
end
The problem with this is you’ll exceed the limit after playing it 256 times.
You should be loaded them in advance.
If for some reason, it’s better for you to load them as they come up, just make sure that your only loading each unique animation once.
local Animations = {
false, false, false
}
if Animations[1] == false then
Animations[1] = Humanoid:LoadAnimation(animationID1)
else
Animations[1]:Play()
end