`engine.runRenderLoop()` still called after stopping & disposing it—resulting in an attempt to read a null property

engine.runRenderLoop will only stop running if you dispose the engine itself and not the scene it is rendering.
To change scenes you will need to change the reference to the scene that the engine is currently rendering. I would separate the engine creation and the scene creation and keep a reference of currentScene. The renderloop should render currentScene, which can be changed at any given moment. To stay safe, make sure the currentScene object is still available before you run render(), and you are good to go

1 Like