Unity Crashes when I try to load an assetbundle scene. Help!

Thanks for reading my post. I have never worked with assetbundles before (never had pro before) and have inherited another programmers project which I need to get using assetbundles again. They worked at some point so I have code, but it does not seem to work now. Did something change between 3-4 with how these have to be called?

Ive spent the last two days reading the forums and trying to get this working… Here is what I have so far. I create the scene assetbundle like this:

[MenuItem("Assets/Build LEVELNAME")]
	static void ExportResourceStreamedScene21 ()
	{
		System.IO.Directory.CreateDirectory ("AssetBundles");
		string[] levels = new string[1] {"Assets/Scenes/ExternalScenes/LEVELNAME.unity"};
		string[] lvlNames = new string[1] {"Streamed_LEVELNAME.unity3d"};
		// Build streamed scene file into a seperate unity3d file
		for (int i = 0; i < levels.Length; i++) {
			string[] lvl = new string[1] {levels [i]};
			BuildPipeline.PushAssetDependencies ();
			BuildPipeline.BuildStreamedSceneAssetBundle (lvl, lvlNames [i], BuildTarget.WebPlayer);
			BuildPipeline.PopAssetDependencies ();
		}
	}

I get an assetbundle just fine (whether or not it is in the right format is another question… I try to load the assetbundle like this:

{
		DebugToLogs.Add ("1");
		if (scenePath.IndexOf ("file://") == 0 || scenePath.IndexOf ("http://") == 0)
			download = WWW.LoadFromCacheOrDownload (scenePath, Settings.manager.GetVersionForScene (levelName));
		if (Application.platform == RuntimePlatform.OSXWebPlayer || Application.platform == RuntimePlatform.WindowsWebPlayer)
			download = new WWW ("../AssetBundles/" + scenePath);
		else if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.WindowsEditor)
			download = new WWW ("file://" + Application.dataPath + "/../AssetBundles/" + scenePath);
		DebugToLogs.Add ("2");
		
		yield return download;
		if (download.error != null)
			DebugToLogs.Add ("WWW download had an error:" + download.error);
			
		DebugToLogs.Add ("4");
		AssetBundle assetBundle = download.assetBundle;
		if (assetBundle != null) {
			DebugToLogs.Add ("5");
			downloadedScenes.Add (assetBundle);
			DebugToLogs.Add("" + levelName);
			downloadedSceneNames.Add (levelName);
			buildSceneList(levelName);
		}
	}

I never get the debug of “4” and long story short I know the issue is when I am yielding for the download. But every time it freezes and I get the “report a bug” screen when the code is run. I’m assuming the error is definitely on my end and not a bug due to my inexperience with assetbundles.

Anyone have any suggestions or a direction to go in? I am very lost in this and running out of time :frowning:

Ok a bit of an update. I can tell that using something above is the more preferred method but I was able to get it to run with creating an assetbundle (track dependencies) and the download and instantiate. I seem to get the same effect, but that is without actually “Loading” into a new level. Is there any large downside to this method? If so what is it? I am trying to reduce file size and this method seems to be a great second option as long as there is no hidden evil in it haha. This is with the Instantiate(www.assetBundle.mainAsset) method.

I just get this problem too. And I’ve check Unity Answers and get a solution in the link below. It seems like a problem with font attached in your script in the bundled scene. After I delete all the scripts with font, the unity editor don’t crash anymore. One more thing, even the Unity Editor crashes, the program goes well as published. So I’m guessing it’s kind of a bug of the editor.