Godot Version
v3.6.stable.official [de2f0f147]
Question
I am using load()
as part of a save-game system. I have a PackedScene
with the following node tree that I have have saved as an .scn file.
I am using the following code to load a new instance of the scene.
func _on_file_dialog_file_selected(path):
var new = load(path).instance()
var container = duplicate_carrier_scene.instance()
for body in new.get_children():
new.remove_child(body)
container.get_node("duplicates").add_child(body)
get_tree().get_root().get_node("main").add_child(container)
The new instance seems to have had all the child nodes duplicated, so the loaded tree looks like this.
What on earth is going on here?