From 2be8cd6863f0fd5daa9a98f0a96d53bc8d23ebd4 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Sat, 17 Dec 2022 19:59:56 +0100 Subject: [PATCH] C#: Add note about the class name in instantiate error Adds a note about the requirement that a C# class name must match the script filename in which the they are defined to the instantiate error. --- modules/mono/csharp_script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index d0f52488bbb..eca53c4831b 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -2292,7 +2292,7 @@ bool CSharpScript::can_instantiate() const { // For tool scripts, this will never fire if the class is not found. That's because we // don't know if it's a tool script if we can't find the class to access the attributes. if (extra_cond && !valid) { - ERR_FAIL_V_MSG(false, "Cannot instance script because the associated class could not be found. Script: '" + get_path() + "'."); + ERR_FAIL_V_MSG(false, "Cannot instance script because the associated class could not be found. Script: '" + get_path() + "'. Make sure the script exists and contains a class definition with a name that matches the filename of the script exactly (it's case-sensitive)."); } return valid && extra_cond;