- Home /
Automatically download and import new assets to application without rebuilding it?
Hi guys, I'm pretty new to Unity so please forgive me if I say something dumb while asking these questions. So there's a small school project that I am participating in. Basically, we want to make a VR Sculpture museum (WebGL platform) that users can submit their sculptures (probably .fbx or .obj) and they will be shown in the museum (the users will probably submit their sculptures through a google form). However, the problem we have with that is that we would have to manually download and import the 3D object to the asset bundle file, add it to the scene, and then rebuild the project every time someone submits a new sculpture file, and that's not what we want to do. So my question is: Would there be anyway to do those steps automatically? In other words, is there a way to create like a bot that always automatically scan new files that users submit on the google form and download them into the asset bundle file, then whenever a user first starts the application, unity would make a call out to a server that we will host our files on (probably on Amazon Web Services) to get the bundle and then import them to the museum?
I know this is very complicated, especially for a beginner like I am, and I'm not even sure if Unity will be able to do all of these tasks. However, if you know there's a way, please just let me know briefly about the steps that will help me to accomplish that, and I will try to figure it out on my own, Thank you so much.
Answer by michaelfelleisen · Jun 04, 2020 at 10:26 AM
you need a file database with all the uploaded files and a list of those files on the server as well. on start your app can request the file list and download all files.
this is done via https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.html
unity can not import 3D models at runtime (e.g. .fbx, .obj, etc.) but there is a library you can use that does this for you:
https://assetstore.unity.com/packages/tools/modeling/trilib-model-loader-package-91777 tbh this sounds like a LOT of work for a small school project but it is certainly possible