Topic was automatically imported from the old Question2Answer platform.
Asked By
Hammer Bro.
Old Version
Published before Godot 3 was released.
My project has a bunch of const SCENE = preload("res://Path/Scene.tscn") style imports. This was all well and good, but now that I’m trying to export a release build for the August 1st game-jam deadline all of my imports fail.
If I export to a zip, I can see that the file names change to res://Path/Scene.tscn.converted.scn, which causes the original preload to fail. But I can’t type that into the editor since it doesn’t exist at edit-time.
What’s the best way to preload resources that works both in the editor and once exported for release?
Oops – figured out what was going on, and it was my fault.
I had excluded *.wav files on my exports because I’ve been toying around with mono/trimmed .smp files. I forgot to update one of my SampleLibraries to use the .smps, so when I ran things from the editor they worked fine because the .wavs still existed, but when I exported it those files did not exist so that scene failed to load which cascaded into just about everything else failing to load, since I’m preloading everything in a global singleton.
So preloading resources as you would expect does indeed work in both the editor and exported releases: preload("res://Path/File.ext")