Simple way to reset the whole scene

Is there a simple way to reset the whole scene? I mean remove all lights, all child spatials (off root and gui), everything attached to the stateManager, input mappings and basically anything else?

Thanks in advance!

Yep ,

node.detachAllChildren();

inputManager.clearMappings();

But in a word, no. Not really.

For example, removing all app states will likely break things. If not now then definitely in the future as the system adds some of its own app states (and will add more in the future).

Really, just keep track of the app states you add. Then remove them again. Have your app states each properly add and clean up with they did. That’s it.

You will be infinitely happier in the long run.

Else the only way to really do it is:
myApp.stop();
myApp = new MyApplication();
myApp.start();

Thanks for the answers. I’ll keep track of everything I add to a scene.