From cd2edfef259386ba2dee0b01741ac612ff4a6547 Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 3 Jan 2024 13:04:16 +0100 Subject: [PATCH] Ignore internal children when replacing node --- scene/main/node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 3cb06e769f4..23df7ed0b0a 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2832,7 +2832,7 @@ void Node::replace_by(Node *p_node, bool p_keep_groups) { } Node *parent = data.parent; - int index_in_parent = get_index(); + int index_in_parent = get_index(false); if (data.parent) { parent->remove_child(this);