I’m needing to load an asset bundle from my device and I’m having an issue doing so.
Right now I have the following code:
string path = "file://" + Application.streamingAssetsPath + "/test.unity3d";
bundle = AssetBundle.CreateFromFile(path);
GameObject obj = (GameObject)Instantiate(bundle.mainAsset);
I’ve returned the location of my path to make sure it is correct (it is) and I’ve placed the appropriate asset bundle in that location. However, when I run my code and try to load the only model in there I get the following error:
When I double click on this error it points to this line of code:
GameObject obj = (GameObject)Instantiate(bundle.mainAsset);
I don’t know what it is I am doing wrong, could someone please help me?