Merge pull request #81506 from twobitadder/reparent_keep_owner

Fix `reparent()` losing owner
This commit is contained in:
Rémi Verschelde
2024-01-11 17:34:19 +01:00
2 changed files with 34 additions and 2 deletions

View File

@@ -739,7 +739,7 @@
<param index="0" name="new_parent" type="Node" />
<param index="1" name="keep_global_transform" type="bool" default="true" />
<description>
Changes the parent of this [Node] to the [param new_parent]. The node needs to already have a parent.
Changes the parent of this [Node] to the [param new_parent]. The node needs to already have a parent. The node's [member owner] is preserved if its owner is still reachable from the new location (i.e., the node is still a descendant of the new parent after the operation).
If [param keep_global_transform] is [code]true[/code], the node's global transform will be preserved if supported. [Node2D], [Node3D] and [Control] support this argument (but [Control] keeps only position).
</description>
</method>