When we’re making the bullets a child of the container node, our script looks like this:
func shoot():
var rocket_instance = rocket_scene.instantiate()
rocket_container.add_child(rocket_instance)
rocket_instance.global_position = global_position
rocket_instance.global_position.x += 75
However, it doesn’t work if we set the global position before adding it as a child of the rocket_container i.e.
func shoot():
var rocket_instance = rocket_scene.instantiate()
rocket_instance.global_position = global_position
rocket_instance.global_position.x += 75
rocket_container.add_child(rocket_instance) # Add as a child last
I’m curious, why does the order matter?