When you no longer need a loaded animation, would deleting the Animation
instance take care of the AnimationTrack
created by Humanoid:LoadAnimation()
for you, or is there better way of doing it?
When you call Humanoid:LoadAnimation()
, the returned AnimationTrack instance should be a descendant of the character. This means when the character is removed or reloaded, the loaded animation will cease to exist.
I’m fairly certain you don’t need to worry about deleting the AnimationTrack. If you no longer need to play the animation, simply don’t play it.
My environment contains frequent held item changes but infrequent respawns, and each item requires its own set of animations. Would gradually piling these up in the client lead to any memory leakage, or and should I simply delete them after they are used?
Alright, I understand that AnimationTracks aren’t very intensive, but I’ll just delete them when swapping items for good measure knowing it inherits :Destroy()
from Instance
. Thanks for the input.