Scripting Animated Tools Help. Do i Unload the animation?

I just wanna know will i run into problems with this? Does calling Stop() on a looped animation unload it?

local Mop        = script.Parent
local Animations = game.ReplicatedStorage.Animations
local Mop_Action = Animations.Action_Mopping
local Mop_Idle   = Animations.Idle_Mopping
local plr        = game.Players.LocalPlayer
local char       = plr.Character or plr.CharacterAdded:Wait()


local ActionTrack = char.Humanoid.Animator:LoadAnimation(Mop_Action)
local IdleTrack   = char.Humanoid.Animator:LoadAnimation(Mop_Idle)

IdleTrack:Play()

script.Parent.Destroying:Connect(function()
	IdleTrack:Stop()
end)
4 Likes

No it doesn’t unload it but it will stop it from playing.~

This statement was half right, when you stop an animation, it will unload from the animator.

3 Likes

so how do i unload it because you can only have 250 animations loaded.

1 Like

Have you tried destroying the animation or the variable itself?

Also you should probably be loading animations on the animator instead of a humanoid.

2 Likes

No, because id need the animation for future use.
Can i load the same animation object twice? because if not my current implementation should work fine, all the anims are in replicated storage.

i am loading them on the animator arent i?

nvm, I read the script wrong, you are indeed loading it on the animator.

Are these animations looped? because if they are unless the animation finishes or is destroyed, then they will continue playing until they stop playing.

My initial thought was wrong, if you do call Stop() on an animation then it should unload itself. mb.

Source:

1 Like

Damn son, you did some digging Thanks alot for the clarification!

Edit: Yes, im calling stop() on a looped animation

I did but without the information given out on another post I would’ve never figured that out and might have led you to a wrongful conclusion.

1 Like

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