TomaszFurca Posted August 22, 2017 Share Posted August 22, 2017 Hey, I start work with many scenes, but i have problem with dispose inactive scenes, after call scene.dispose() or engine.dispose() bjs freeze chrome TAB. How i can successful delete scene with all meshes, actions etc? Quote Link to comment Share on other sites More sharing options...
adam Posted August 22, 2017 Share Posted August 22, 2017 If you have no luck disposing a scene, then maybe you can reuse them. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 22, 2017 Share Posted August 22, 2017 This is not expected. scene.dispose() should just work. Can you repro somewhere where we can see it? Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted August 23, 2017 Author Share Posted August 23, 2017 Open my game http://babylon.furcatomasz.pl/. And go your player to fireplace (there is pinned event to change scene) and then window with game will be frozen. I don't know how can i debug it. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 23, 2017 Share Posted August 23, 2017 This is a bit too complex to debug do you mind to create a simpler repro? Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted August 24, 2017 Author Share Posted August 24, 2017 On PG i cannot replace this problem, so i start to debug source code of BJS and found problem there: Scene.prototype.disposeSounds = function () { this.mainSoundTrack.dispose(); /// This line of code freeze my TAB ... }; In my project I register some empty BABYLON.Sound (without file) and then scene cannot be disposed. After remove empty BABYLON.Sound it works! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 24, 2017 Share Posted August 24, 2017 ok good news! Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted August 25, 2017 Author Share Posted August 25, 2017 Next problem - when i want dispose scene in intersectionEnter event in action manager i got error. Check it on PG: https://www.babylonjs-playground.com/#WWCK0#44 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 25, 2017 Share Posted August 25, 2017 You cannot dispose the scene while using it. You have to call the scene.dispose() inside a setTimeout to be able to do it TomaszFurca 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.