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…