- Home /
[AssetBundle]object is not instantiate from my server
Hi
I have used the asset bunble for instantiate my asset in my scene. This is the first time i am started using the assetbundle. I droped the simple cube in my dropbox folder and i got the link. Then i have used this simple script to instantiate that cube.
function Start () {
var www = WWW ("https://www.dropbox.com/s/drvaucv7l61c77g/Cube.unity3d");
yield www;
// Get the designated main asset and instantiate it.
Instantiate(www.assetBundle.mainAsset);
}
but its not working it in my unity editor as well as the web applications. It showing the following error: NullReferenceException: Object reference not set to an instance of an object BundleLoader+c__Iterator0.MoveNext () (at Assets/Script/BundleLoader.cs:17)
How should i solve this. Please help me to get out of this.
Thanks.
Answer by MaT227 · Apr 10, 2014 at 07:15 AM
You first need to know if it's your www.assetBundle
or you www.assetBundle.mainAsset
which is null.
Than as this error can come from several reason I suggest you to follow the great documentation about AssetBundles available here: Unity - AssetBundles
There are a lot of example code that you could test.
Your answer
Follow this Question
Related Questions
How to import the object from server to unity 2 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
yield on WWW? or AssetBundleRequest? or both? 2 Answers
AssetBundles between Levels 1 Answer
assemblies can not turn to bundle 2 Answers