Hi,
I’m trying to load a txt file during runtime:
I did put my “w1.txt” file in the “Resources” folder but it only works in the editor,
when I make an Android build it doesn’t load my text, it’s like my .txt file is not imported in the APK.
Does anyone have any idea ?

“Resource” folder or “Resources” folder?
Have you tried referencing that asset in one of your scripts? Have public variable on a script and drag&drop you resource on it in inspector.
No, I’m gonna try. But even if it works I would like to understand why a txt file is not considered as an asset, and automatically packed in the APK.
The normal assets are only packed into APK if they are used. I’m not sure about resources. StreamingAssets are always put to apk.
I also tried putting the .txt file in the StreamingAssets, it doesn’t work either with Android build (I used the System.IO.File with the Application.streamingAssetsPath).
That won’t work, System.IO can’t read files from streaming assets. Use UnityWebRequest for that.
1 Like