Cannot load cached AssetBundle. A file of the same name is already loaded from another AssetBundle.

hello…

I am loading gameobject from assets bundle on server. Code which i am using is here :

IEnumerator Start () {

		string model  = PlayerPrefs.GetString("LoadModel" , "GoblinBundle");
		string url = "http://oceanstechnologies.com/service/emailcampaign/websites/tempr/unity/"+model;
		// Start a download of the given URL
		#if   UNITY_ANDROID && !UNITY_EDITOR
		url += ".android.unity3d";
		#elif UNITY_IPHONE  && !UNITY_EDITOR
		url += ".iphone.unity3d";
		#else
		url += ".unity3d";
		#endif

		www = WWW.LoadFromCacheOrDownload(url, 1);
		yield return www;
		
		//Debug.Log("Loaded ");
		
		if (www.error != null)
			throw new Exception("WWW download had an error: " + www.error);
		
		AssetBundle assetBundle = www.assetBundle;
		skull = Instantiate(assetBundle.mainAsset) as GameObject; // Instantiate(assetBundle.Load("AssetName"));
		skull.transform.position = new Vector3(0 , 0.0f , 15.0f)
		skull.gameObject.SetActive(false);

	}

I am getting my object loaded but on next scene i want same object to be loaded/use. when i write this code in next scene , i got this error.

So how can i use this same object in another scene .

Thanks…

HI,

Try Object.DontDestroyOnLoad.

Link : http://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html

Let me know if you have any concern.

Thanks
Aman

I solved by unloading it to false like

     bundle.Unload(false);