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:
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.
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.
Did u ever figure out the solution to this problem? I am currently having the same one.
Probably not as its been 2 years and still marked as unsolved or theyve just forgotten
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!
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.