Use get_tree().root for root node.

This commit is contained in:
Nolan Darilek 2018-06-07 21:13:55 +00:00
parent e42b054e86
commit 3694e50dda

View File

@ -11,9 +11,7 @@ func augment_node(node):
func set_initial_screen_focus(screen): func set_initial_screen_focus(screen):
print("Screen ",screen) print("Screen ",screen)
var focus var focus
var root = self var root = get_tree().root
while root.get_parent() != null:
root = root.get_parent()
if screen == "3D": if screen == "3D":
focus = root.find_node("ToolButton", true, false) focus = root.find_node("ToolButton", true, false)
print("Focus ",focus) print("Focus ",focus)