diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 8c2b6a1790b..15b4186aa1a 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2667,8 +2667,6 @@ Node *Node::_duplicate(int p_flags, HashMap *r_duplimap) c node->data.editable_instance = data.editable_instance; } - StringName script_property_name = CoreStringName(script); - List hidden_roots; List node_tree; node_tree.push_front(this); @@ -2865,7 +2863,7 @@ void Node::remap_nested_resources(Ref p_resource, const HashMap props; p_original->get_property_list(&props); - StringName script_property_name = CoreStringNames::get_singleton()->_script; + const StringName &script_property_name = CoreStringName(script); if (p_flags & DUPLICATE_SCRIPTS) { bool is_valid = false; Variant scr = p_original->get(script_property_name, &is_valid);