I am a beginner at godot and I have a theory about making one basic node as the main scene and this node will not be replaced until it exits the game.
main_scene
level_1
Inside that node I can store variables using get_parent().health= 25
then i can put variable in new level by
level_1
var = scene = level2.instance()
scene.health = get_parent().health
get_parent().add_child(scene)
free()
then
main_scene
level_2
it can also load a new level without pausing the background music like this
main_scene
level_2
AudioStreamPlayer
Because main_scene
is only a basic node which means that the child scene can be either 2d node or 3d node.
And if you want to save the game you can get all the necessary variables with get_parent().variable
if the variable has been export
And this should be used for background loading while being cutscenes or load the most important scenes to load first so that the game will be more optimized, such as openworld games or games with large or scalable maps
I don't know if this method works or not, I hope the community can answer