diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index f86b00e17ab..37e06de9685 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -933,7 +933,13 @@ void SceneTreeDock::perform_node_renames(Node *p_base, Listget_path(); NodePath rel_path_old = root_path.rel_path_to(E->get().first); - NodePath rel_path_new = root_path.rel_path_to(E->get().second); + + NodePath rel_path_new = E->get().second; + + // if not empty, get new relative path + if (E->get().second != NodePath()) { + rel_path_new = root_path.rel_path_to(E->get().second); + } // if old path detected, then it needs to be replaced with the new one if (p == rel_path_old) {