Improve the resource loading error message to mention the need to import

This is a common pitfall when setting up projects in a headless
environment.
This commit is contained in:
Hugo Locurcio 2020-08-22 22:19:08 +02:00
parent 2ba96f0dd9
commit 58ed3037c0
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
1 changed files with 2 additions and 1 deletions

View File

@ -195,7 +195,8 @@ RES ResourceLoader::_load(const String &p_path, const String &p_original_path, c
return res; return res;
} }
ERR_FAIL_COND_V_MSG(found, RES(), "Failed loading resource: " + p_path + "."); ERR_FAIL_COND_V_MSG(found, RES(),
vformat("Failed loading resource: %s. Make sure resources have been imported by opening the project in the editor at least once.", p_path));
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
FileAccessRef file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES); FileAccessRef file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES);