AssetBundles, not working ... "not been added to the build settings"

Hi guys,

i’m pretty new to unity.
I have a few big landscape scenes (all in different projects) i’d like to load these dynamically in one unity game (pc/mac).
I created seperate assetBundles from them.

So in my first landscape scene when u enter a door, it loads another scene.
The script in the bottom is attached to that door.
When i run it it gives the error:
“Level: ‘Ename_test.unity’ (-1) couldn’t be loaded because it had not been added to the build settings.”

I’ve been looking on this forum for hours, but nothing solved this, although a lot of the same topics :confused:
Anyone knows a solution? thanks!


using System;
using UnityEngine;
using System.Collections;

public class CachingLoadExample : MonoBehaviour {
	public string BundleURL;
	public string AssetName;
	public int version;

	void OnTriggerEnter(Collider other)
		StartCoroutine (DownloadAndCache());

	IEnumerator DownloadAndCache (){
		// Wait for the Caching system to be ready
		while (!Caching.ready)
			yield return null;

		// Load the AssetBundle file from Cache if it exists with the same version or download and store it in the cache
		using(WWW www = WWW.LoadFromCacheOrDownload (BundleURL, version)){
			yield return www;
			if (www.error != null)
				throw new Exception("WWW download had an error:" + www.error);
			AssetBundle bundle = www.assetBundle;


Ok so with a stream scene asset bundle you don’t do bundle.LoadAll - you just take the reference to it from the WWW.

Secondly you need to open the scene with its name - not it’s file name, just the scene name part of it (like you would if it was added to the build).