diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index fea7d151dfa..b7ca3c882b0 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -3216,6 +3216,7 @@ void VisualScriptEditor::_move_nodes_with_rescan(const StringName &p_func_from, { List data_connections; script->get_data_connection_list(p_func_from, &data_connections); + int func_from_node_id = script->get_function_node_id(p_func_from); HashMap>> connections; @@ -3225,6 +3226,11 @@ void VisualScriptEditor::_move_nodes_with_rescan(const StringName &p_func_from, int out_p = E->get().from_port; int in_p = E->get().to_port; + // skip if the from_node is a function node + if (from == func_from_node_id) { + continue; + } + if (!connections.has(to)) { connections.set(to, Map>()); }