0 votes

I have an error that i completely not understand, what is this?
I tried solution that this error said but call_deferred() not exist anywhere, documentation can't search it

0:00:00:0541 - Parent node is busy setting up children, add_node() failed. Consider using call_deferred("add_child", child) instead.
---------- Type:Error Description: Parent node is busy setting up children, add_node() failed. Consider using call_deferred("add_child", child) instead.
Time: 0:00:00:0541 C Error: Condition ' data.blocked > 0 ' is true. C Source: scene\main\node.cpp:1336 C Function: Node::add_child
in Engine by (33 points)
edited by

1 Answer

+1 vote
Best answer

it happens when adding new node by add_child() in _ready()
call_deferred is defined in Object class. (you can find it with Search Help on editor.)

so actually you can call it with any nodes.

func _ready():
    call_deferred("add_child", new_child)
by (9,511 points)
selected by

i wrote "

call_deffered

" in documentation by accident :D
So, when i use add_child in ready func, i always must do this call?
It is a normal practice?

I have not tried to find when it happens.
but it does not happen always.
probably, in some complicated condition.

How do you call call_deferred on something else than the current node?

I understand that doing this :
calldeferred("addchild", new_child)
has the same meaning (apart from the "deferred" part, of course) as doing that :
this.addChild (new_child)

...but what would be the deferred equivalent to this :
gettree().getroot().addChild(new_child)

I know this is old, but for those who are looking for the answer to this question is to still call CallDeferred, but on the Root rather than the current node:

func _ready():
    get_tree().get_root().call_deferred("add_child", child_node)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories