Home / Godot / G17

Godot error: Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead. — cause and fix

Calling add_child synchronously during the parent's _ready or a batch child setup, while t

ID
G17
Engine
Godot
Verification
源码原文(scene/main/node.cpp:1721)
Frequency
未公开

Original message (verbatim)

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

Placeholders such as %s / %d are kept verbatim from the engine source and are not replaced with concrete values.

Trigger

Calling add_child synchronously during the parent's _ready or a batch child setup, while the parent is blocked setting up its children.

Typical cause

add_child aborts when data.blocked > 0; synchronously inserting new children is not allowed while the scene tree batch setup is in progress.

Step-by-step fix

  1. Use add_child.call_deferred(child) to run it after the current setup pass finishes.
  2. Move dynamic attachment to _process or after the scene is ready; do not attach sibling children directly inside _ready.
  3. Make sure you are not inserting nodes synchronously inside a batch notification callback.

Source links

Per-entry sources and capture date are listed at /sources#G17.

Related errors

Related Godot errors

Need an offline quick-reference checklist?

Atlas error library Pro pack: 123 error references (110 single + 13 merged) plus a quick-fix guide, $19 one-time purchase, delivered as electronic files.

View Pro pack / order

Back to the all-errors index Checkout and buy the Pro pack — $19.00