Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | PrOoOg | |
Old Version | Published before Godot 3 was released. |
i’m trying to instance the bullet scene instead the main scene and i’m having this error:
parent node is busy setting up children, add_node() failed. Consider using call_deferred(“add_child”, child) instead.
the script is attached to the player node, direct child of the scene node.
func _ready():
var bulletscene = load("res://scenes/bullet.tscn")
var bullet = bulletscene.instance()
get_node("/root/level").add_child(bullet)
set_process(true)
set_process_input(true)