Topic was automatically imported from the old Question2Answer platform.
Asked By
51m0n55
tree:
-kinematicbody(autoload)
–raycast
i have a get_node() command in the kinematicbody script, but it returns error with
the node being a null instance. in other non-autoload nodes it works fine. what is happening??
Read about autoload in documentation more
Autoload exists aside of the sene tree, it is a nodeless script. It can’t have children and any structure, so get_node can’t work. It also doesn’t have any way of reaching a scene tree, get_tree() returns null. However every node of your scene tree can refer to Autoload scriptwithout any knowledge of own scene tree structure, and this where it becomes truely useful