I need to load new scene and dispose the old one. But it shows nothing.
Set ActiveCamera like this post doesn’t work
Thanks for helping!
The problem is solved by 2 actions:
- Change the scene target when create guiMenu
const guiMenu = AdvancedDynamicTexture.CreateFullscreenUI(‘ui’, true, sceneToLoad);
- Add active camera after change scene from old scene to new scene
The second actions should be the difference between Babylon version 5 vs 6
In version 5, no need active camera, version 6 needs it
The PG you posted has multiple issues to begin with
- doesn’t work at all
- it’s a ts type code, but it’s a js type pg
- you imported your local project, so it’s different from PG’s render rules
Here’s what we found
If I press a button in scene 1, scene 2 (maybe Game?) should run after scene 1 is discarded?
Maybe what you’re missing is the part about dispose and render.
check PG then tell me if there are any more special conditions
Generally speaking, if it is entered as a parameter of a scene when created, it will be inherited by the scene and removed on dispose, and you will need to create a new one.
var camera = new BABYLON.ArcRotateCamera(“Camera”, 5, 1, 15, new BABYLON.Vector3(0, 0, 0),