1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-02 16:48:55 +00:00

Add warning when node name is invalid

This commit is contained in:
AdvanceControl
2025-11-02 14:00:53 +08:00
parent 0fdbf050e0
commit 0d46d42f2a

View File

@@ -1437,6 +1437,9 @@ void Node::set_name(const StringName &p_name) {
data.name = p_name; data.name = p_name;
} else { } else {
data.name = StringName(validated_node_name_string); 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()));
} }
} }