Merge pull request #112907 from Amogh-2404/docs/clarify-node-duplicate-subtree

Clarify that Node.duplicate() duplicates entire subtree recursively
This commit is contained in:
Thaddeus Crews 2025-11-18 08:25:42 -06:00
commit d28db795f8
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -280,7 +280,7 @@
<return type="Node" />
<param index="0" name="flags" type="int" default="15" />
<description>
Duplicates the node, returning a new node with all of its properties, signals, groups, and children copied from the original. The behavior can be tweaked through the [param flags] (see [enum DuplicateFlags]). Internal nodes are not duplicated.
Duplicates the node, returning a new node with all of its properties, signals, groups, and children copied from the original, recursively. The behavior can be tweaked through the [param flags] (see [enum DuplicateFlags]). Internal nodes are not duplicated.
[b]Note:[/b] For nodes with a [Script] attached, if [method Object._init] has been defined with required parameters, the duplicated node will not have a [Script].
[b]Note:[/b] By default, this method will duplicate only properties marked for serialization (i.e. using [constant @GlobalScope.PROPERTY_USAGE_STORAGE], or in GDScript, [annotation @GDScript.@export]). If you want to duplicate all properties, use [constant DUPLICATE_INTERNAL_STATE].
</description>