Skip to content

Node.duplicate() creates extra nodes under certain conditions #76593

@radlotus

Description

@radlotus

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

  1. Take a node that has some children.
  2. Pack this node and its children into a PackedScene
  3. Save the PackedScene
  4. Load the PackedScene and instantiate it
  5. Set the owner property of the instance's children to null
  6. Duplicate the node

Minimal reproduction project

node_duplicate_creates_extra_nodes_godot3.zip
node_duplicate_creates_extra_nodes_godot4.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions