If you want to get the root of the scene you made in the editor, you can use get_tree().current_scene
.
Note: this is actually not the real root. The real root is a Viewport
node representing the actual game screen, and is obtained by doing get_tree().get_root()
, or get_node("/root")
.
current_scene
is a child of this node, and autoload nodes are children of it the viewport as well.