summaryrefslogtreecommitdiff
path: root/demos/misc/autoload
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2015-11-22 18:25:19 +0100
committerRémi Verschelde <rverschelde@gmail.com>2015-12-09 08:39:12 +0100
commit52d515b611ed1f593e23b0adabedbd9fd59dc7db (patch)
treef58497abcecc0a74d3d12132f134a5e0b279cc24 /demos/misc/autoload
parent6315dd4985b828f649980361d987923d2197561d (diff)
Use get_current_scene() instead of hack
Diffstat (limited to 'demos/misc/autoload')
-rw-r--r--demos/misc/autoload/global.gd8
1 files changed, 2 insertions, 6 deletions
diff --git a/demos/misc/autoload/global.gd b/demos/misc/autoload/global.gd
index e094ab9784..2671b6f412 100644
--- a/demos/misc/autoload/global.gd
+++ b/demos/misc/autoload/global.gd
@@ -33,9 +33,5 @@ func _deferred_goto_scene(path):
func _ready():
- # Get the current scene, the first time.
- # It is always the last child of root,
- # after the autoloaded nodes.
-
- var root = get_tree().get_root()
- current_scene = root.get_child(root.get_child_count() - 1)
+ # Get the current scene at the time of initialization
+ current_scene = get_tree().get_current_scene()