Tool Error: Animation Track Limit of 256 tracks for one animator exceeded

Hey roblox community I’ve been having a few issues regarding animations and tools. Theres a glitch that started to show up around 4 months into the making of my game which would say “Animation Track Limit of 256 tracks for one animator exceeded”. I thought the problem I had was having the code in my tools LoadAnimation everytime you swing therefore piling up animations. So in order to fix this glitch, I made all the tools call the same animation everytime the tool runs. I did that by wrapping the anim Tracks in variables when equipping and playing the same track every attack. When I play tested though, I had the same glitch. So at that point I remembered that the crouch and slide animations used the same loadAnimation feature that the tools used to, so I went and did the same for them. But again when I play test the game after playing for a while I get that error.
Ps. I run a for loop that stops all the animations used by the tool when its unequipped

So basically my question is, does my for loop remove the animation track from the humanoid or are they stacking up somehow in the humanoid and causing that error.

2 Likes

When you stop an animation, it doesn’t automatically unload or remove the AnimationTrack from the Animator. The AnimationTrack will only be removed from the Animator instance when the animations finishes playing.

1 Like

So what’s the conclusion, and what if the animation loops? Theres gotta be a simplier way to unload animations from the humanoid.

1 Like

I’m not quite sure there is a way to unload animations, just don’t load alot of them I guess?

1 Like

you can do animationtrack:Destroy()

1 Like