How can I get the length of an animation?

So I need to get the length of an animation, I’ve seen that after you have a loaded animation it has a length value and I tried this but I always get 0, I dont know if its cause my animation is like 0.6 seconds long but Idk, so how can I get the length of the animation?

1 Like

Can you show the part of the script where you load the animation and try to get the length?

1 Like

It might either be bc in the length is measured in seconds. And also that the length might not be immediately loading.

1 Like

Length

A read only property that returns the length (in seconds) of an AnimationTrack. This will return 0 until the animation has fully loaded and thus may not be immediately available.

There is no option but to wait for it to load, which is not synchronous with the LoadAnimation() function call, it happens sometime later when the data is actually fully loaded from the CDN.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.