Godot Engine

Godot Engine

Checkov Mar 2, 2018 @ 12:48pm
get_tree().get_root() issue
Hello! I'm having issues calling get_tree().get_root() in one of my scripts. (it runs perfectly well in all of my other scripts). It tells me that get_tree() returns null. Has anyone had a similar issue?
< >
Showing 1-2 of 2 comments
Akien  [developer] Mar 2, 2018 @ 1:50pm 
I guess that this would happen if the node to which you attached that script is actually not in the scene tree. It can happen if you removed it from the scene tree with remove_child, or if you instantiated it from another script, but forgot to use add_child to actually add it as a child of a node of your scene tree.
Checkov Mar 2, 2018 @ 2:47pm 
Someone explained it on the Facebook page. I was calling it before I used add_child
Last edited by Checkov; Mar 2, 2018 @ 2:48pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: Mar 2, 2018 @ 12:48pm
Posts: 2