From 468ecf2141da995592bc2e25fa07b94351e1df77 Mon Sep 17 00:00:00 2001 From: Bashar-R Date: Tue, 3 Mar 2026 15:56:00 -0500 Subject: [PATCH] Fix editable children state when duplicating instantiated nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Pedro J. Estébanez (cherry picked from commit c0706bb71d1ae85a17e3b25a463ab6c192fe213c) --- scene/main/node.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 7218287e23..d723df7718 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2866,6 +2866,19 @@ Node *Node::_duplicate(int p_flags, HashMap *r_duplimap) c } } } + + for (List::Element *N = node_tree.front(); N; N = N->next()) { + const Node *source_node = N->get(); + if (source_node->get_scene_file_path().is_empty()) { + continue; + } + + NodePath relative_path = get_path_to(source_node); + Node *duplicated_node = node->get_node_or_null(relative_path); + ERR_CONTINUE(!duplicated_node); + + duplicated_node->data.editable_instance = source_node->data.editable_instance; + } } if (get_name() != String()) {