- Home /
Uploading files at runtime and use them in a built game
I would like to allow the users of my game to upload their images and then display them in the game. I wanted to create an upload element (as in HTML) and when the users select their images, upload them into the "Resources" folder but I read somewhere that it's impossible because the resources folder is already compiled. Is it?
Then I thought of doing that using an AssetBundle but I'm not sure if it's possible to create an AssetBundle using a compiled game and then upload it to a server.. Is it possible? How do I do that?
Is there a better way to achieve what I wrote above?
Also, how do I do that with 3D assets. Is it possible?
There is one folder that is never compiled and it is Strea$$anonymous$$gAssets
It's true, you cannot use Resources folder (nor any other folder), because they get compiled into the application. In fact, it is a good practice to only have data files as resources in your project (you can add text files, xml files, JSON files and you can load it from the project).
What you could do is to upload the images to a server, then get the images using a WWW request, and load it into the game. But I'm not sure that would work.
Answer by Legend_Bacon · Feb 28, 2018 at 04:41 PM
Hello there,
If you want to store and use the image locally, I'd recommend looking into the very useful Application.persistentDataPath. I do something similar at the office, and it seems to work just fine.
Hope that helps!
Cheers,
LegendBacon