- Home /
I want to load object from my computer or google drive.
Hi, I just succeeded load an object with asset bundle.
However, this method can only load objects that I have previously designated.
I want to load the desired object from the computer or Google Drive with one Load button.
I do not know how to solve this problem. Give me some advice.
Thanx.
Answer by xxmariofer · Nov 17, 2020 at 11:59 AM
take a look into the System.IO class https://docs.microsoft.com/es-es/dotnet/api/system.io.file?view=net-5.0 and UnityWebRequest https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.html classes for achieving that
Thanx. I am trying to solve this problem with UnityWebRequest.
But I have 2 errors now. but I can not find why...
Here are my script and errors. (I do not know much about C#..that is why)
$$anonymous$$y final goal is loading object what I want during play a game. For that, I need public tap 'Asset Name' to choose what I want. (I will make asset bundles with some objects and upload to my google drive first)
Give some advice. Thanx.
First, can you share with me the errors? i cant see them in your script, only a deprectaed alert (WWW is the old version of UnityWebRequest) second, I once worked with google drive myself and i know that drive url is not right, you need the final url, not the share link the url should be something like this change the allthenumbers text to your file id (the one in your url):
Thank you for your commnet xxmariofer.
It seems difficult to give advice because it shows only a part sorry. Explaining the purpose would be a little more efficient, so I will explain. I am trying to make an Asset Bundle called 'Tree'. The 'Tree' contains various 3D obj file trees; Firtree, Oaktree, Palmtree, etc. I want to upload that asset bundle to my google drive and select and load it while playing the game. I set it so that it can be loaded by clicking the button called ‘Load’. Further, we want to load the selected obj file by entering the desired tree (ex. Firtree) in the game.
So I included assetName (=File name like Firtree) and bundleURL (= my Google Drive address) as public. As I went around YouTube and forums and tried to match the sources little by little, I was getting an error I didn't understand.
In summary, I want to know how to load the desired object into the game within the Asset Bundle uploaded to Google Drive.
There are still many things that are still lacking, so I would like you to explain in detail. Thank you very much.
as i said, you are not using the right url, you are using the share url, but notice, that after you click on that share url a second page will open, it will be fast but that second url is the one you need to use and it will end with somewthing like "&export=download&authuser=0" try to get that url and try again, or easier create a webserver in your personal pc and access the file from the server, will be a lot easier
'create a webserver in your personal pc and access the file from the server, will be a lot easier' means use like 'XA$$anonymous$$PP Control panel'??
Thank you so much