Game restarting Point

Hiii … I want to reset a game scene after time’s up .
https://playcanvas.com/project/975847/overview/onam-fork
in this the game start with a UI showing to select character … After time’s up i need to reset only the game scene and not want to show character selection UI …
I have tried with this one
var oldHierarchy = pc.app.root.findByName(“Root”);
oldHierarchy.destroy();
this.app.loadSceneHierarchy(‘1515752.json’, function (err, entity) {
if (err) {
console.error(err);
}
});

But it reload from the UI. Is it possible to reset only the game scene without showing the character selection UI

https://playcanvas.com/project/975847/overview/onam-fork

Hi @Kiran_Raj_N_V,

Good thinking in using scene destroy for that. The way to do that would be to separate your UI and Game to separate scenes.

You will be loading your UI first and then additively the game scene on top. At any point you will be able then to destroy and reload your game scene without affecting the UI state.

There is a great example that shows that here: Additive Loading Scenes | Learn PlayCanvas

1 Like