- Home /
Resources.Load not working in standalone build
Hi
I have problem with Resources.Load. It works fine in editor but when using standalone build value returned by this method is null. What can cause this kind of problem ? I'm calling the method like this:
Resources.Load<SettingsObject>("Settings");
Settings.prefab file is located in Assets\Editor\Resources\Settings.prefab
I think you should just place it in "Assets/Resources/" for it to be included in both editor build and real build.
Answer by Elmah · Jul 11, 2021 at 11:09 AM
I needed to move my Resources directory to Assets directory so the path is now Assets\Resources as in @rh_galaxy reply. I'm using Unity verson 2019.2 so it might be the way it works in this version.
Edit:
I've read in documentation that "Editor" is special folder name so that's why files there were not included in standalone build:
Editor scripts add functionality to Unity during development, but aren’t available in builds at runtime.