confused with instantiating scenes and initialization order

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kinori

Preload a scene and instantiate it by code and found its child node not having been created or initialized when setting its properties.I know i can use *_deffered() .I wonder, is there a more elegant way to solve this?

:bust_in_silhouette: Reply From: Inces

calling instance() also calls init() of new object
calling add_child() also calls ready() of new object, unless it was reparented before.
There is now way around it, and it works pretty well.
If You found a child node, than it was created, wasn’t it ? Its init() must have been called, and ready() has been called if it was childed for the first time. I bet You mistook something and did it wrong. Can You specify more what exactly wasn;t initialized in your node ?