Game Development Community

getIsAnimationFinished() returns 0 on non-cycling animation

by Teromous · in Torque Game Builder · 04/13/2009 (8:27 am) · 1 replies

I'm running a behavior, where I want to call an animation as soon as the previous one is finished. The animation is non-cycling, but getIsAnimationFinished() will not trigger a 1. I tried calling an echo to test it out inside a while loop:
while(%this.owner.getIsAnimationFinished() == 0)
{
echo(%this.owner.getIsAnimationFinished());
}
...which expectantly crashes the game, but the console dump is:
0
0
0
0
0
...etc, so I'm wondering why a non-cycling animation won't pass a 1, and if anyone knows a way to fix this or a workaround.

#1
08/07/2009 (7:35 am)
I think i found a hint on why it does not work. I had the same issue with an animation having 7 frames (but built from a cell static sprite having 8 frames, i do not know if it counts) and its time was set to 10 frames/sec. getIsAnimationFinished() never returned 1, so to try my luck i set the time to 12 and *yay* it works.
I think it is the calculated duration for the animation that screws it up.

Or maybe I am wrong and i was just lucky this time.

If anyone has any hint on this bug please let us (or at least me ;p ) know.

Thank you very much in advance.