This is a limitation of animation properties. There is a delay between loading the animation and being able to depend on things like priority and looped.
The delay used to be strictly less than 1 second for me. Then it creeped up to 2 seconds… then 5. I gave up. I needed priority, and i couldn’t wait 5 seconds every time i loaded an animation.
That delay is longer the first time an animation is used in game. No matter what the delay was, it was only ever incorrect for the first load.
There is a workaround. Add a Looped or Priority property to the Animation object. That value will be accurate immediately.
Ok I believe it’s because every animation has their looping set to being disabled. I don’t believe you put looping is true anywhere in your code so this may be why?
It seems like this is the issue, I added a huge delay (6s) before checking if it loops or not, and it works correctly. I don’t quite understand your workaround, could you explain it differently?
In the properties window, scroll to the bottom of the animation object. There, you can add whatever property (aka attribute) you want, then retrieve it with object:GetAttribute("property ")
You can add attributes to multiple objects at the same time, making it a relatively painless bypass
Could it also work if I use a BoolValue instead? I am inexperienced with attribites, I’ve only ever used them once. I also intend for the animations to be able to change.
Something to watch for in the update logs… I got confirmation of this behavior from Roblox staff months ago (when it was still 1 second). I proposed that they should add a .Loaded event to animations to identify when the properties are fully populated. They seemed agreeable to this solution. I would go back to using .Priority in a heartbeat. Less room for human error!