Closed davidpuetter closed 1 year ago
I tried looking into this, but have not found an issue .. it would need more time and deeper investigation, perhaps another time.
As a workaround (not the same behaviour, I understand) would be to remove the previous scene before new one gets loaded.
SceneSwitchButton.prototype.loadScene = function() {
var oldHierarchy = this.app.root.findByName('MyScene');
var scene = this.app.scenes.find("GameScene");
oldHierarchy.destroy();
this.app.scenes.loadSceneHierarchy(scene.url, function (err, parent) {
if (!err) {
} else {
console.error(err);
}
});
};
A smaller repo of this project as another client ran into this issue: https://playcanvas.com/project/971118/overview/adding-batch-group-entity-at-rt
Description
Static models in a scene that have a Batch Group assigned disappear when the same scene is destroyed and reloaded, regardless of whether or not the batcher has ran.
Project Link Forum Post Link
Upon first load, you'll see a couple of plane entities laid out. The outer circle of planes have no batch group assigned, whereas anything inside the circle have a single batch group assigned with its layer set to World. Once you reload the scene by pressing 'L', you'll notice that all the planes that had a batch group assigned disappear from the scene, and the ones without a batch group remain in place as expected.
Tested on Windows 10 (2004 - 19041.985) using Google Chrome v91.0.4472.77, and Firefox v89.0, PlayCanvas v1.42.0
Steps to Reproduce
SceneRegistry.loadSceneHierarchy
to reload the scene and destroy the old hierarchyScreenshots
Screenshot 1 - Before reloading the scene![Iy78cxYn](https://user-images.githubusercontent.com/7888472/121571020-6a851880-ca1a-11eb-820c-dea962fdfe4a.png)
Screenshot 2 - After reloading the scene![EIodJzAK](https://user-images.githubusercontent.com/7888472/121571051-71ac2680-ca1a-11eb-8397-7f468a32e13f.png)