Loading animation information

I just want to ask whenever it is possible to get the information about an animation (like it’s length, if it’s looped or not, weight etc.) without loading it onto an animator?

I’m building a custom animation system and this would come really handy to save performance.

You can use InsertService to load the animation and only then check if it’s looped or not, it’s length, etc. There isn’t any other way.

One benefit from this method is that you can delete the animation later on so you can scavenge the RAM space back.

One major disadvantage to this is that InsertService only works on the server.

I tried a few variations, but I can’t seem to get any of the animation properties other than the loop one after loading the animation’s ID with insert service. Could you attach an example or link anything for reference?

Animation priority is also attached with the sequence when you use insert service. You can get the length by checking the Time value of the children keyframes of the initial sequence inserted via Insert Service. Basically:

local length = 0
for _,keyframe in sequence:GetChildren() do
   length = math.max(keyframe.Time,length)
end
1 Like