Godot version
3.6 beta 1 and 4.0.3 RC1
Issue description
Node.duplicate() doubles the children nodes under certain conditions.
It doesn't occur otherwise.
Steps to reproduce
- Take a node that has some children.
- Pack this node and its children into a PackedScene
- Save the PackedScene
- Load the PackedScene and instantiate it
- Set the
owner property of the instance's children to null
- Duplicate the node
Minimal reproduction project
node_duplicate_creates_extra_nodes_godot3.zip
node_duplicate_creates_extra_nodes_godot4.zip