Code execution order in _ready()

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ugly_cat
:warning: Old Version Published before Godot 3 was released.

Is there anyway to control the order in which code in disparate script files will run in the _ready() function? Basically I’m using get_node() to grab a node which is instanced via another node. This throws an error because it wasn’t able to find the node because it wasn’t instanced yet!

Please use back quotes to mark code, that will avoid _ to be interpreted as an italic marker.
e.g. _ready()

Akien | 2016-03-01 10:15

:bust_in_silhouette: Reply From: alket

You can use: onready var node = get_node(), before anything else, outside of all functions