AnimationTrack limit of 256 exceeded (Loading Animations wrong?)

This is pretty straightforward-- This pet replication port is simply playing animations requested by other players, for their individual pets. This does exactly what I have the players local pet animation script does, yet this leads to this unfortunate error:

2 Likes

Humanoid:LoadAnimation() is now deprecated. Use Animator:LoadAnimation(), where Animator is a child’s of the humanoid of the player’s character model to load animation instead.

True, but this is unfortunately not the reason for this bug.

1 Like

These are all valid, but the mystery in my bug is that :Destroy is being called on the AnimationTrack’s, therefore it shouldn’t be accumulating anything.

2 Likes

Did u ever figure out the solution to this problem? I am currently having the same one.

1 Like

Probably not as its been 2 years and still marked as unsolved or theyve just forgotten

1 Like

For this issue you need to go through the current playing animations inside the animator using:

Animator:GetPlayingAnimationTracks()

During the loop you can check if your animation is already loaded into the animator, if it is then just call :Play() or :Stop() on that loaded animation track!

2 Likes

You can use animator to load animation,it works like Humanoid:LoadAnimation() but it just in an Animator.Or if you thinking using Humanoid in a script.Best to make an event and fire to a local script,you just need to load the animation as a variable in the first line and when the even got fired,it will play the anim and don’t worry!The animation will show up to other players too!

bump

I encountered this issue recently and finally figured out what was wrong. It was because one of the animations had failed to load (presumably got moderated) and every time I called AnimationTrack:Play() on the server, it would load a new instance of the AnimationTrack into the Animator and try to play it, effectively duplicating the animation into infinity.

Not sure if this was your issue, but in my case it wasn’t an error with my code.

2 Likes