Keyword
Onready
is a keyword that basically states set the variable
when it is ready
This is most useful with node's and scenes as you may want to access or set properties that won't be available until it is ready (which happens when the node is properly added to the scene tree)
Additional info
The onready var
is the same as setting the var in the _ready()
function of the requested node / scene
The variable
is assigned before the _ready()
func of the calling script but wont be set until its available so in cases where an error occurs its possible for the var to return null