@GarromOrcShaman said:
@arthur said:
When you change_scene()
or change_scene_to()
, the singleton (or autoload) nodes are preserved. The function does not replace root node. It just changes active scene, without touching singleton nodes.
So if is everything inside tree, the tree what get replaced, where is singleton node then ?
The engine is smart enough to just change node of current scene. It does not touch the root node or any of its children that is not the current scene node.
Example:
root
|- singleton 1
|- singleton 2
L current scene node
When you call change_scene()
, the only node that will be changed is current scene node
. The other nodes (root
, singleton 1
and singleton 2
) won't be affected at all.