How to use onAnimationEnd

Hi @mecanicus <- cool handle! :slight_smile:

Here is how we use it in a jump animation…

        animo = nx.scene.beginAnimation(nx.aSkeleton[0], 20, 25, false, 1.0); //compress
        animo.onAnimationEnd = function (){
            var jmp1 = nx.scene.beginAnimation(nx.aSkeleton[0], 25, 35, false, 1.0);  //jump apex
            jmp1.onAnimationEnd = function(){
                nx.anmz.jump.jumpMode = 0;
                var jmp2 = nx.scene.beginAnimation(nx.aSkeleton[0], 35, 50, false, 1.0);  //landing
                jmp2.onAnimationEnd = function(){
                    nx.scene.beginAnimation(nx.aSkeleton[0], 80, 140, true, 1.0);  //idle
                }
            }
        }
3 Likes