From 0e25cd0788bcd35b4af93642e4e8802cf698bc4a Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 18 Mar 2022 01:26:27 +0100 Subject: [PATCH] Mention that Node's `owner` must be set for persistence to work This is already done in `Node.add_child()` documentation, but this copies the note in `Node.owner` for good measure. (cherry picked from commit be1acf3b92b8b7104fe4d1fab9fbd2a28400ff95) --- doc/classes/Node.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 54085172ce5..121b1d0344b 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -118,7 +118,7 @@ child_node.get_parent().remove_child(child_node) add_child(child_node) [/codeblock] - [b]Note:[/b] If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=https://godot.readthedocs.io/en/3.2/tutorials/misc/running_code_in_the_editor.html]tool scripts[/url] and [url=https://godot.readthedocs.io/en/latest/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view. + [b]Note:[/b] If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=$DOCS_URL/tutorials/misc/running_code_in_the_editor.html]tool scripts[/url] and [url=$DOCS_URL/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view. @@ -741,6 +741,7 @@ The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using [PackedScene]), all the nodes it owns will be saved with it. This allows for the creation of complex [SceneTree]s, with instancing and subinstancing. + [b]Note:[/b] If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=$DOCS_URL/tutorials/misc/running_code_in_the_editor.html]tool scripts[/url] and [url=$DOCS_URL/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view. Pause mode. How the node will behave if the [SceneTree] is paused.