• Godot Help
  • How do you use call_deffered() or set_deferred() for this situation?

I have a hard time understanding this kind of sketchy bug. I hope somebody could decode this please. What happens here is that I call this script's spawn() function whenever I kill all the enemy in a room. Its not a kind of bug that would crash the gameplay but I'm still afraid that this would bite me off my back later on.

  • Are the errors caused by the get_parent() call?
    In that case, you could replace it with this:
    get_parent().call_deferred("add_child", "node")
    An alternative is to use call_deferred() to call the spawn() method.

Are the errors caused by the get_parent() call?
In that case, you could replace it with this:
get_parent().call_deferred("add_child", "node")
An alternative is to use call_deferred() to call the spawn() method.