Godot Engine

Godot Engine

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?
< >
1-2 van 2 reacties weergegeven
Akien  [ontwikkelaar] 2 mrt 2018 om 13:50 
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.
Someone explained it on the Facebook page. I was calling it before I used add_child
Laatst bewerkt door Checkov; 2 mrt 2018 om 14:48
< >
1-2 van 2 reacties weergegeven
Per pagina: 1530 50

Geplaatst op: 2 mrt 2018 om 12:48
Aantal berichten: 2