I just had an issue with my exported version and after much searching I tracked it down to to typo. Totally my fault, I admit, but it is a bit odd.
When loading a resource the Godot Editor worked fine even though I had a typo in my resource path. I didn’t get an error message and it worked flawlessly
var MyScene = preload(“res://Scenes/ThisScene.tscn”)
and
var MyScene = preload(“res://Scenes/thisScene.tscn”)
Both worked fine running from the editor but only the correct one worked in the exported version. Note the difference is the capital T in thisScene/ThisScene
Should there be an error message for this when the wrong one is used in the editor?
var my_scene = preload(“res://scenes/this_scene.tscn”)
PascalCase is reserved for class names. Variable names should be snake_case. You don’t have to do that, but it will help when debugging, and when you post questions here.
Thanks. Makes sense. I think it would be good to have a soft warning. It warns me that I have declared a variable and not used it so it would be nice to at least mention that my code won’t run on some platforms, especially Windows. I will be more careful in future though
Turns out there was a bug. In 3.5 this problem showed as an error when running in the editor, but that error code is missing from 4.5. I am in no qualified to fix it but I have posted it on the Github