Hey was just wondering if this is the proper way to load scenes? It seems like when I can scene Switcher and go to a new scene, the previous scene objects are still active. Iβm trying to go to a new scene and remove the previous scene and any objects with it. Any help is appreciated
public goToScene(index: number) {
this.switcher ??= this.getSceneSwitcher();
const oldIndex = this.switcher?.currentIndex;
this.switcher?.select(index).then(res => {
// Need to unload the old scene or it wil save
this.switcher?.scenes[oldIndex].unload();
});
}