Finding where a loading error originates

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By fullmontis

I have removed a resource file that I didn’t think was used in the project. However, I found a handful of errors when starting up the game that tell me that Godot was unable to load the resource. Clicking the error however only goes to the error in the c++ source code, and doesn’t tell me where the error is originating from.

Does anyone know how to locate the scene that is using a specific resource?

I ended up solving this by grepping the missing resource in the project sources and removing all occurrences of it by hand with an external text editor. This isn’t ideal though, so I’ll be waiting for other answers that may have a better solution.

fullmontis | 2022-03-02 11:47

:bust_in_silhouette: Reply From: Zylann

You might get more information by launching the game in verbose mode (“verbose output” in Project Settings, I believe? Otherwise launch from command line with -v).
When the first load error occurs, previous log entries in the console might tell you what it tried to load. Otherwise I don’t think there is any other way without that setting.

You could also try opening scenes of your game, and the editor might tell you if they failed to load something.

Next time you want to remove a resource, try doing so from the editor, maybe it will check for you if scenes depend on it.
But it isn’t flawless, so indeed, doing a global text search remains the most reliable way to check where a resource is used. Not just for scenes, but also scripts that might load it by name.