diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-09-21 01:43:42 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-09-21 01:43:42 -0300 |
commit | 11a5ed508b1cbde61a4d9dd4f469e86e74667623 (patch) | |
tree | e4bc1926057d788aeeef3633930bb958eb976d3a /demos/misc/autoload | |
parent | c5b905fca82f1437486f2168270c5caa0b4bf104 (diff) |
Fixed too many little issues, check the issues closed today.
Diffstat (limited to 'demos/misc/autoload')
-rw-r--r-- | demos/misc/autoload/global.gd | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/demos/misc/autoload/global.gd b/demos/misc/autoload/global.gd index d9fa308a2f..dca661a31a 100644 --- a/demos/misc/autoload/global.gd +++ b/demos/misc/autoload/global.gd @@ -9,6 +9,11 @@ func goto_scene(scene): var s = ResourceLoader.load(scene) #queue erasing old (don't use free because that scene is calling this method) current_scene.queue_free() + # Remove the scene before loading the previous one. + # The node is removed when deleted anyway, but this will fix issues that + # might arise if both have a root node with the same name, + # as adding both together will cause the second to be renamed. (not usually a problem, but you might be wanting to look for the node later and not find it) + get_scene().get_root().remove(current_scene) #instance the new scene current_scene = s.instance() #add it to the active scene, as child of root |