Hi there, just started using Babylon.js, specifically using the Editor. (v.3.2.0). I’ve previously used Unity, but wanted to try out other engines to broaden my horizons.
I’ve been trying to set up my project to load between two scenes, and have followed the Explaining the Workflow documentation to the end to create a working project.
All went well, until I needed to change scenes, and the documentation mentions: “What Wasn’t Covered: How to change scenes, like in a video game”. So I’ve been digging around on my own, with some success.
I’m currently using SceneLoader.Append in a script within the editor to load in the other scene into the main scene, and the scene does get loaded in, but without any of the scripts attached to objects in the scene. The constructors are not called, and it’s just the scene with the meshes.
I think the problem lies in the OnSuccess callback of SceneLoader.Append. In the game.ts file, Extensions.ApplyExtensions gets called inside the callback function, where the Code Editor extension for that specific scene gets loaded. I tried writing the same thing in my own scene change function, but when I try to include ‘import { Extensions } from “babylonjs-editor”’ to get access to the Extensions class, the code editor says “babylonjs-editor” doesn’t exist.
I’m at an impasse at this point, as I’m not sure how to fix this, and I’ve been searching for a solution for the past day to no avail. Anybody have any idea how to get scripts from another scene working in the current scene using SceneLoader.Append, if I’m doing it right at all, or just a better way to change scenes? I could really use some help