Topic was automatically imported from the old Question2Answer platform.
Asked By
YAGU
I have a bit of a understanding problem what exactly get_tree() returns.
In the documentation I’ve read that it returns the SceneTree, but what exactly does that mean? Does it return all nodes that I have in my current scene or does it return my root-node?
So get_tree() returns an (or better the) instance of this class. The instance itself then has means to access the nodes inside it. SceneTree itself is not a node, but a descendant of MainLoop. Think of it as a manager class that takes care of updating and managing all the nodes in it while running in an infinite loop until the player exits the game (get_tree().quit()).
ah I understand, thank you for the detailed answer!