Skip to content

Parent node is busy setting up children, `add_child()` failed in Godot 4

By Eduardo Orellana · Updated

The parent is in the middle of adding its children, and Godot refuses to change that list until it is done. get_parent().add_child(child) from a child's _ready() prints Parent node is busy setting up children, `add_child()` failed. Defer the call: get_parent().add_child.call_deferred(child).

AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.

Intel or AMD Chromebook, with Linux turned on.

Download for macOSDownload for WindowsDownload for Linux

What Godot is checking

While a node is adding its children and running their _ready(), it marks itself blocked. add_child() on a blocked node prints this error and returns without adding anything; the script carries on, so the child is simply missing.

call_deferred() runs the call at the end of the frame, after the parent has finished, when the child list can change.

More on this: Can't add child '…' to '…', already has a parent '…' in Godot 4

Reproduce it

A node that adds a sibling from its own _ready(), while its parent is still setting up.

GDScript
extends Node

func _ready() -> void:
	var spark = Node.new()
	spark.name = "Spark"
	get_parent().add_child(spark)
	print("after")

What Godot 4.7.2 prints

Output
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org

ERROR: Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead.
   at: add_child (scene/main/node.cpp:1721)
   GDScript backtrace (most recent call first):
       [0] _ready (res://answers/parent-node-is-busy-setting-up-children/repro.gd:6)
after
WARNING: 1 ObjectDB instance was leaked at exit (run with `--verbose` for details).
   at: cleanup (core/object/object.cpp:2536)

Fix it

GDScript
extends Node

func _ready() -> void:
	var spark = Node.new()
	spark.name = "Spark"
	get_parent().add_child.call_deferred(spark)
	await get_tree().process_frame
	print(get_parent().has_node("Spark"))

What the fixed script prints

Output
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org

true

Run this fix with your agent

Flockbay is the Godot editor with an AI agent built in. Paste this into Flockbay's chat, or into Claude Code or Codex connected to Flockbay over MCP: the agent finds the cause in your project, applies the fix, runs the game headless and reads Godot's output to check it.

More on this: How to change scenes in Godot 4: change_scene_to_file()

Prompt
My Godot 4 project prints this error: "Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead.". Find where it comes from and fix it. The parent is in the middle of adding its children, and Godot refuses to change that list until it is done. get_parent().add_child(child) from a child's _ready() prints Parent node is busy setting up children, `add_child()` failed. Defer the call: get_parent().add_child.call_deferred(child). Then run the game headless and check that Godot's output no longer shows it.

Verified on Godot 4.7.2

Both scripts on this page were run headless on Godot 4.7.2 (4.7.2.stable.mono.official.ed1daf0bf) on 18 October 2026, and the output above is what Godot printed, unedited.

Where the check lives in Godot's source: node.cpp line 1721, the message.

Questions

Why does add_child() work in _ready() on the same node?
A node can add its own children in _ready(). It is the parent, still running its children's _ready(), that is blocked.
Is call_deferred() the same as await process_frame?
No. call_deferred() runs at idle time at the end of the current frame; await get_tree().process_frame waits for the next frame to start.

Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.

Download Flockbay free