From 0d46d42f2ab3114ae291ea1a53d8cccebd39cff9 Mon Sep 17 00:00:00 2001 From: AdvanceControl <163237388+AdvanceControl@users.noreply.github.com> Date: Sun, 2 Nov 2025 14:00:53 +0800 Subject: [PATCH] Add warning when node name is invalid --- scene/main/node.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index dbd790c6269..5d329cc9e01 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1437,6 +1437,9 @@ void Node::set_name(const StringName &p_name) { data.name = p_name; } else { data.name = StringName(validated_node_name_string); + WARN_PRINT(vformat( + R"(Node cannot be renamed to "%s" because it contains characters that are not allowed. The node was renamed to "%s" instead. The following characters are not allowed: %s)", + input_name_str, validated_node_name_string, String::get_invalid_node_name_characters())); } }