I also received this bug about an hour ago after logging onto Studio from about 3 hours prior, however I wasn’t doing anything with animation. I don’t have animations in my game, and this error is breaking my game.
Works for me, but I include a 1 second delay after every LoadAnimation to wait for the priority field to properly populate. It’s possible this is an error/bug of calling the animation too quickly.
Hi, this is the correct solution. A change that just went live introduces a new, faster and more consistent way to load animation asynchroneously in AnimationTrack. The result is that some of the API calls to tracks before they are properly populated should not be done. However, this should just be a warning message and no side-effect instead of crashing your scripts. We have turned off this new codepath for now (which should come into effect quickly after your next reboot) and we will drop the severity of the error reporting in the next release.
I think it would be a fantastic feature to add if LoadAnimation would trigger an event when the load is complete. Right now, every YouTube tutorial out there recommends calling LoadAnimation right before you need the animation, and playing it immediately.
Once this change goes live again, what would be the recommended way to call animations without arbitrary yielding? As far as I know, there isn’t really a
AnimationTrack.Loaded:Wait()
and repeatedly calling Length ~= 0 isn’t really a viable alternative. I’m not really a big fan of it spamming my console with warning messages since I need to see my own debug messages.
Edit: Rethinking again, I suppose we can load all the animations we need beforehand and play them as needed, however, there are many times still where even after loading all of them, we need them to play immediately.
This is how I handle it. As soon as the model is loaded, I load the animations. Then I wait… and then I drop them on the map. You can play the animation immediately, as long as you change what that means.
Does this mean that the current :LoadAnimation() will be deprecated? If a new method which yields until the animation has loaded is added, could we be given time to update our code so that this error (or warning, in the future) is prevented?