When to use and when to not use add_child.call_deferred?

Godot Version

4.6

Question

I came across this error sometimes:

ERROR: Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead.

In _ready() function during project start running, add_child alone will fail, so call_deferred has to be used.

So should call_deferred be used everywhere? When to use and when to not use it to ensure the game will not have any issue?

No. Use it only when you get that error.

Better yet eliminate the error by not trying to add or alter siblings from _ready(). Do everything in parent’s _ready()

2 Likes