what is the difference between enter tree and _ready function ?when to use each?
Hi,
As I know in more cases ready function is used.
ready
The difference is enter_tree is called for each child added to tree in top-to-bottom order while ready is called in bottom-to-top order, so in enter_tree you can't rely on child nodes yet.
enter_tree
Yes enter_tree is called as soon as a node enters tree, but it's children it depends on might/should not be in the tree or ready yet. Mean while ready is called when a node and it's children are ready. And as @GlyphTheWolf mentioned, obviously it has to be bottom to top in order for that to work right.