hit2501 Posted December 27, 2015 Share Posted December 27, 2015 Hi everyone and merry Christmas. I need to play a group of animations when an "if" condition happens. I tried with this:if(cond > 1){ elevador.actionManager = new BABYLON.ActionManager(scene); elevador.actionManager.registerAction( new BABYLON.CombineAction(BABYLON.ActionManager.NothingTrigger, [ new BABYLON.PlayAnimationAction(BABYLON.ActionManager.NothingTrigger, elevador, 0, 288, 0), new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.NothingTrigger, function () { scene.registerBeforeRender(function () { if(camera.position.y < 102){ camera.position.y += 1; } }); }), new BABYLON.PlaySoundAction(BABYLON.ActionManager.NothingTrigger, sonidoElevador) ]) );}But this dont work. What changes can I do to achieve it? Thanks. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted December 27, 2015 Share Posted December 27, 2015 If cond > 1, looks like the action is registered. The point of an action registration is to declare what should happen in advance. You could just do it, since you do not want do it right then.if(cond > 1){ scene.registerBeforeRender(function () { if(camera.position.y < 102){ camera.position.y += 1; } }); sonidoElevador.play();} Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.