From c16a79ebdf6ad1bd9be5ecef5005505d45a3ec11 Mon Sep 17 00:00:00 2001 From: jonathandw743 Date: Tue, 10 Dec 2024 16:30:53 +0000 Subject: [PATCH 1/3] node export notes --- tutorials/scripting/gdscript/gdscript_exports.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tutorials/scripting/gdscript/gdscript_exports.rst b/tutorials/scripting/gdscript/gdscript_exports.rst index a2ac8ec4a43..9dadb1c9b1d 100644 --- a/tutorials/scripting/gdscript/gdscript_exports.rst +++ b/tutorials/scripting/gdscript/gdscript_exports.rst @@ -258,6 +258,13 @@ without having to use NodePaths: # Custom classes declared with `class_name` can also be used. @export var some_button: BaseButton +.. note:: + + Node export is only supported in Node-derived classes. When a Node is + saved to a PackedScene, using ``Node`` or ``Array[Node]`` will store a + reference to a Node in the scene, but using ``Array`` or `Dictionary` + to store Nodes will cause a copy of each Node to be created. + Exporting NodePaths like in Godot 3.x is still possible, in case you need it: :: From 7d4a80191f616d8f9a756b35d3c5c2802f649ad0 Mon Sep 17 00:00:00 2001 From: Jonathan Wilson <85790952+jonathandw743@users.noreply.github.com> Date: Sun, 15 Dec 2024 18:19:20 +0000 Subject: [PATCH 2/3] exporting instead of export Co-authored-by: Max Hilbrunner --- tutorials/scripting/gdscript/gdscript_exports.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/scripting/gdscript/gdscript_exports.rst b/tutorials/scripting/gdscript/gdscript_exports.rst index 9dadb1c9b1d..6464e8cd17e 100644 --- a/tutorials/scripting/gdscript/gdscript_exports.rst +++ b/tutorials/scripting/gdscript/gdscript_exports.rst @@ -260,7 +260,7 @@ without having to use NodePaths: .. note:: - Node export is only supported in Node-derived classes. When a Node is + Node exporting is only supported in Node-derived classes. When a Node is saved to a PackedScene, using ``Node`` or ``Array[Node]`` will store a reference to a Node in the scene, but using ``Array`` or `Dictionary` to store Nodes will cause a copy of each Node to be created. From dcd5f302b43720e6ef356fc496819d6904023c7a Mon Sep 17 00:00:00 2001 From: Jonathan Wilson <85790952+jonathandw743@users.noreply.github.com> Date: Sun, 15 Dec 2024 18:19:33 +0000 Subject: [PATCH 3/3] fixed back-ticks Co-authored-by: Max Hilbrunner --- tutorials/scripting/gdscript/gdscript_exports.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/scripting/gdscript/gdscript_exports.rst b/tutorials/scripting/gdscript/gdscript_exports.rst index 6464e8cd17e..3d2a78efc05 100644 --- a/tutorials/scripting/gdscript/gdscript_exports.rst +++ b/tutorials/scripting/gdscript/gdscript_exports.rst @@ -262,7 +262,7 @@ without having to use NodePaths: Node exporting is only supported in Node-derived classes. When a Node is saved to a PackedScene, using ``Node`` or ``Array[Node]`` will store a - reference to a Node in the scene, but using ``Array`` or `Dictionary` + reference to a Node in the scene, but using ``Array`` or ``Dictionary`` to store Nodes will cause a copy of each Node to be created. Exporting NodePaths like in Godot 3.x is still possible, in case you need it: