[AssetBundle]object is not instantiate from my server


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.

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.


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.