zouarino Posted November 29, 2014 Share Posted November 29, 2014 I want to stop the animation but this code doesn't work please help my. var createScene = function () { var scene = new BABYLON.Scene(engine); var camera = new BABYLON.ArcRotateCamera("Camera", 3 * Math.PI / 2, Math.PI / 8, 50, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, false); var light = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, 0), scene); BABYLON.SceneLoader.ImportMesh("a", "scenes/", "ww.babylon", scene, function (newMeshes) { newMeshes[0].position = BABYLON.Vector3.Zero(); newMeshes[0].autoAnimate = false; newMeshes[0].autoAnimateLoop = false; }); return scene;} Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 29, 2014 Share Posted November 29, 2014 you should just use scene.stopAnimation(newMeshes[0]) Madclaws, Raitch and Buzul 2 1 Quote Link to comment Share on other sites More sharing options...
zouarino Posted November 29, 2014 Author Share Posted November 29, 2014 thanks Quote Link to comment Share on other sites More sharing options...
Tomek Posted October 18, 2018 Share Posted October 18, 2018 I can see that there is a method called stopAllAnimations I wonder how to do the opposite (after I have stopped them) and run them all again? I tried: newScene.meshes.forEach(m => newScene.startAnimation(m)); but it doesn't work. Quote Link to comment Share on other sites More sharing options...
bghgary Posted October 18, 2018 Share Posted October 18, 2018 I think the function you are looking for is beginAnimation (you can pass 0 and Number.MAX_VALUE for the from and to parameters). Quote Link to comment Share on other sites More sharing options...
Tomek Posted October 18, 2018 Share Posted October 18, 2018 Actually I just handled it like this and it seems to work: scene.animationsEnabled = true; scene.animationsEnabled = false; GameMonetize 1 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.