[SOME KIND OF SOLVED] Call function after blend interval is done on animations

Hi there!

ive a question about animations i’m playing and reseting.

My playanimation works good but i want to reset animations using:

this.soundboxEntity.anim.baseLayer.transition('Initial', 0.5); 
this.qrCodeEntity.anim.baseLayer.transition('Initial', 0.5);

This should make the animations go back to 0 - but because the animation will continue playing i made:

            //setTimeout(, 250); 
            setTimeout(() => {
                this.soundboxEntity.anim.playing = false;
                this.soundboxEntity.anim.baseLayer.pause();
                this.soundboxEntity.anim.baseLayer.activeStateCurrentTime = 0;
                
                //this.qrCodeEntity.anim.playing = false;
                this.qrCodeEntity.anim.baseLayer.pause();
                this.qrCodeEntity.anim.baseLayer.activeStateCurrentTime = 0;
             }, 500);

the timeout matches the blend transition interval. Now the problem:
On mobile - due to performance differences - it could be, that i dont stop the animation excactly on 0 - after the transition is done. The reason is, that the user can then start the animation again - but i want those animated entitys to be on 0 after the transition from end of the animation to its start. with the setTimeout it sometimes stops near the 0 time - and you can see this of course, that its not at 0.

Is there a method i could call to check, if the animations transition is on 0, then call all the pause and playing = false methods?

The setTimeout has may a delay and isnt preceise on mobile.

Would be very happy about each idea how to achieve this - i spend to much time on this :smiley:

Ok while playing around - i made a idle animation with speed 0 then switching to this animation playing the transition to idle - and the user then calls the other animation state playAnim…

this is some kind of workaround but seems to work :slight_smile: