Exported project can't load scene, load file failed.

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

I just created a little project and tried to export it. Everything works perfectly in the editor.

The export template I use is the Windows Desktop, Runnable, export all scenes.

The weird thing is that I can get into my main menu, but when I try to move to any game scenes, it brokes.

1.Also i tried to change the main scene to other game scenes instead of the menu and run it, the executable immediately crash.

2.when I export the project as a zip and unzip the file, put exe in and run, it works.

  1. Few days ago, when I exported the project, with probably nothing changed in the menu and the first scene, It works. But now after I made some changes, it doesn’t work even with those which works before.

Something is wrong with the path stuff?

here’s the error when I am in the menu and try to change scene.

Godot Engine v3.2.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: GeForce GTX 1060/PCIe/SSE2

ERROR: load_source_code: Condition “err” is true. Returned: err
At: modules/gdscript/gdscript.cpp:806
ERROR: Cannot load source code from file ‘res://Sprite.gd’.
At: modules/gdscript/gdscript.cpp:2244
ERROR: Failed loading resource: res://Sprite.gd.
At: core/io/resource_loader.cpp:278
ERROR: poll: res://Ball.tscn:5 - Parse Error: [ext_resource] referenced nonexistent resource at: res://Sprite.gd
At: scene/resources/resource_format_text.cpp:440
ERROR: Failed to load resource ‘res://Ball.tscn’.
At: core/io/resource_loader.cpp:208
ERROR: Failed loading resource: res://Ball.tscn.
At: core/io/resource_loader.cpp:278
ERROR: poll: res://colworld.tscn:6 - Parse Error: [ext_resource] referenced nonexistent resource at: res://Ball.tscn
At: scene/resources/resource_format_text.cpp:440
ERROR: Failed to load resource ‘res://colworld.tscn’.
At: core/io/resource_loader.cpp:208
ERROR: Failed loading resource: res://colworld.tscn.
At: core/io/resource_loader.cpp:278

Is it basically telling me that the stuff I tried t load simply not exist?

Did you check the casing of your resource files? (i.e Sprite.gd) It is a typical problem on Windows that if you make a casing typo/change, loading scenes appears to work in the editor, but once exported won’t work. That’s because the Windows file system is case-insensitive, but the exported package is case-sensitive.
If it’s not, you could maybe provide your project so we can have a look?

Zylann | 2020-02-28 21:09

:bust_in_silhouette: Reply From: Mimaca233

Solved. It is the case problem but I just didn’t find it out. So the problem is that, there is a script called “Sprite.gd” and “sprite.gd”. However, the “sprite.gd” With lower case is not in the file system, (means there are not such file in local) but it still appears in the game’s script editor and direct to the same file as the upper case one.