Info: Why do we use _ready() and not _enter_tree()?

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

No problem, just wondering why we use one function over the other. Every tutorial/demo/example I have seen prefers the _ready().

According to the documentation, the only difference is _enter_tree() fires when it enters the SceneTree where as _ready() waits for all the children as well before firing.

Is there another other pattern-based reason for using one over the other?

Thanks.

:bust_in_silhouette: Reply From: damncoder

If your object “preloaded” in the scene tree it will be better use
_ready() (it will be correctly initialized).

If your plan instance object during the game - use _enter_tree()

I am often use _enter_tree() connected to object signal.