From 073fa753760a7a7a4da7ad9c6993192b6e58b10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 22 Nov 2015 18:25:19 +0100 Subject: [PATCH] Use get_current_scene() instead of hack --- misc/autoload/global.gd | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/misc/autoload/global.gd b/misc/autoload/global.gd index e094ab97..2671b6f4 100644 --- a/misc/autoload/global.gd +++ b/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()