You can also access nodes of a scene right after it is instanced, but before you call add_child
. Beware though, onready
variables would still be uninitialized, and neither _ready
nor _enter_tree
would have been called. This means that the nodes are still not really ready to work with, and might give weird errors on things that normally work. E.g. functions like set_pos
might work and change the position, while a utility function that calls expects _ready
to set some nodes for it might fail. YMMV.
Another idea would be to thinker with the node right after add_child
, which would still be before a new frame is drawn, but after _ready
has finished processing. This might be the best idea if you have a lot of utility functions in the instanced scene's scripts, since they would be fully initialized at that point.
A third option (Before instancing, but it's readonly) is discussed by @GlaDOSik in his answer.