hit2501 Posted March 27, 2015 Share Posted March 27, 2015 Hi again. I can animate two meshes imported from Blender by pressing a cube (OnPickTrigger) but now I need that the animations run alone when the page finish to load. How can I do that? This is my code until now:Cube.actionManager = new BABYLON.ActionManager(scene);Cube.actionManager.registerAction( new BABYLON.CombineAction(BABYLON.ActionManager.OnPickTrigger, [ new BABYLON.PlayAnimationAction(BABYLON.ActionManager.NothingTrigger, Mesh01, 0, 123, 0), new BABYLON.PlayAnimationAction(BABYLON.ActionManager.NothingTrigger, Mesh02, 0, 123, 0) ])).then(new BABYLON.CombineAction(BABYLON.ActionManager.OnPickTrigger, [ new BABYLON.PlayAnimationAction(BABYLON.ActionManager.NothingTrigger, Mesh01, 123, 235, 0), new BABYLON.PlayAnimationAction(BABYLON.ActionManager.NothingTrigger, Mesh02, 123, 235, 0) ]));Sorry if my english is no good Thank you all. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted March 29, 2015 Share Posted March 29, 2015 You can simply use body.onload() or document.addEventListener( "DOMContentLoaded", your_function, false );And you call :Cube.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger, BABYLON.ActionEvent.CreateNew(Cube)); 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.