diff options
author | Ryan Roden-Corrent <ryan@rcorre.net> | 2020-01-02 06:25:17 -0500 |
---|---|---|
committer | Ryan Roden-Corrent <ryan@rcorre.net> | 2020-01-02 21:50:31 -0500 |
commit | 98bbee3008acf60474b80c2764ef342e590dd339 (patch) | |
tree | 37198e18786d82caf45a1c30fa98d3afdb2a87b6 | |
parent | 1788b22b118db02ed57487c62157f83ab73b4165 (diff) |
Add note about add_child and owner.
Resolves #34739.
-rw-r--r-- | doc/classes/Node.xml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 193cfeb0ff..e3f1165c55 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -129,6 +129,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/latest/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. </description> </method> <method name="add_child_below_node"> |