A manager looks messy on the usual way (real singletons) but on Godot are just scenes with special behaviour and location on the tree, you can have many for different uses, like managing connections, pauses, saves and other top level stuff, if well organized (with groups, notifications, etc.), the self-contained approach should not be affected by those utility scenes, on the contrary, that will prevent it because depending on external nodes breaks that containment directly.
The time to call get_node
is from _enter_tree
and until _exit_tree
, on _ready
the Node/scene should be fully initialized in the tree so is usually safe to use it there (normally there is no need to process nodes before ready).
If you want to postpone the call (you may need a node that is not -yet - on the tree), call_deferred
should help, to assign to a variable do call_deferred
on a function that process the initialization part that depends on the get_node
(maybe with hasnode>getnode and call deferred again if fail).
Adding all to a group and letting something else notify all of them for a special set-up (notify_group
/call_group
) may be cleaner IMHO.
More or less like the answer of avencherus.