Most reliable way to load animations

I am trying to get an animation track’s length so that I can play them for a set duration (and speed them up or slow them down accordingly), but all the track’s animation lengths are 0 (on both client and server) until I fully play the animation for the first time. I’ve tried preloading them with content provider, but that did not seem to help at all. Does anyone know a workaround?

1 Like

Could always try:

-- psuedo code
if animTrack.Length == 0 then
	animTrack:GetPropertyChangedSignal("Length"):Wait()
end

or good ole reliable:

if animTrack.Length == 0 then
	repeat task.wait() until animTrack.Length > 0
end
1 Like

Both of these yield infinitely. The animation’s length stays at 0 until I first play the animation.

1 Like

Dang never heard of this before… do you own the animations by chance? Could be due to that… if so then I honestly don’t know.

Yes, I own the animations. It’s really annoying how even preloading them doesn’t fix this.

The solution is to create a rig with an animator and load and play all the animations on it on the client. This is a pretty stupid solution, and it doesn’t make sense how preloading the animations does not mean they are immediately ready to be used.

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