- Home /
Download assetBundle from server
Hi every one, im trying to donwload asset bundle and then instantiate any gameobject from that. But i dont understand what im doing wrong. i was watching some tutorials, but still doeanst work. Canu help me pls? When im strarting Scene console write me this error :
NullReferenceException: Object reference not set to an instance of an object loadAsset+c__Iterator0.MoveNext () (at Assets/Scripts/loadAsset.cs:16)
and here is my script :
using UnityEngine;
using System.Collections;
public class loadAsset : MonoBehaviour {
private string url = "https://www.dropbox.com/s/juk97y0ovyruhpc/skuska.unity3d";
IEnumerator Start () {
WWW www = WWW.LoadFromCacheOrDownload (url,1);
yield return www;
AssetBundle bundle = www.assetBundle;
GameObject kocka = bundle.Load("Cube", typeof(GameObject)) as GameObject;
Instantiate(kocka);
kocka.transform.Translate (new Vector3(1,1,1));
}
}
i was trying to use other server but still doeasnt work. Can u help with my problem? oh sure script its name is "ExportAssetBundles" i have in Editor Folder in my project.
Thanks Thomas
Hey,
The only problem I see here is that when I paste the url provided by you in a browser it takes me to a download page and not the actual downloadable asset.
In this case... try this LIN$$anonymous$$ ....
This is the actual downloadable asset that you have uploaded.
Use this as your url string : "https://www.dropbox.com/s/juk97y0ovyruhpc/skuska.unity3d?dl=1"
Hope this works for you.
Cheers.
Is this problem solved? I'm in the same error right now and still haven't found any solutions.
Answer by Paulius-Liekis · Jul 23, 2014 at 04:05 PM
The link is broken: https://www.dropbox.com/s/juk97y0ovyruhpc/skuska.unity3d
When working with WWW always check that WWW.error is null after "yield return www;".
$$anonymous$$y url was workingm, but later i deleted this unity3d file... but proble is with this error : NullReferenceException: Object reference not set to an instance of an object loadAsset+c__Iterator0.$$anonymous$$oveNext () (at Assets/Scripts/loadAsset.cs:16)
i dont really dont know what it needs... i was trying everything, but still doesnt works... any idea how fix it? Thanks
Answer by ksiUnity · May 28, 2015 at 07:06 AM
U can try uploading your unity3d files to either google sites or maybe use WinSCP as a server.
Your answer
Follow this Question
Related Questions
Reading XML file 0 Answers
What's the matter downloading with 3G 0 Answers
Cannot load cached AssetBundle 1 Answer
Destroying Instantiated Prefab from AssetBundle 1 Answer
Assetbundle materials? 1 Answer