royibernthal Posted December 13, 2016 Share Posted December 13, 2016 I have a scene with 5 models with animations. Each model is supposed to act like that: idle animation in loops by default whenever an action is called, it is played, and when its animation is completed, the model goes back to idle animation in loops The scene starts with 5 models in the idle animation loop. Click the "Test" button to trigger an action animation. 1) Is there a way to remove onComplete callback from an Animation once it is created? It seems it is also triggered by animation.stop(), and I'd like to avoid that. I tried to null animation.onAnimationEnd but it resulted in very weird behavior. 2) Each time I try to play an action animation in all models by hitting the "Test" button, animations are played on a seemingly random (probably not really random) number of models, and the rest simply stop (probably following the stop() call). If you try to hit the "Test" button a couple of times during an action animation you'll notice an even weirder behavior. Why is this happening? If I use a setTimeout to delay playing a new animation after stopping the previously played one, it seems to create some order in the chaos, but I'd like to understand better what's going on, since even this is a very imperfect solution that has its own problems, or possibly other problems that'd appear regardless of this one. Here's the PG: http://www.babylonjs-playground.com/#1SVN3I#46 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.