- Home /
Loading Scene from Asset Bundle
I'm trying to save my scene as a StreamedSceneAssetBundle and then reload it from the same project (different scene). Whenever I try and reload the scene, it says the scene is not a StreamedSceneAssetBundle (isStreamedSceneAssetBundle returns false). Not sure why this is happening because I use BuildStreamedSceneAssetBundle to create the StreamedSceneAssetBundle.
Heres the code I use to build the asset bundle:
string[] level1 = new string []{"Assets/Test.unity"};
BuildPipeline.BuildStreamedSceneAssetBundle( level1, "testSceneBundle.unity3d", BuildTarget.iOS);
Heres the code I use to reload the asset bundle:
string sceneUrl = "google drive link";
WWW bundleWWW = WWW.LoadFromCacheOrDownload(sceneURL, 1);
yield return bundleWWW;
AssetBundle assetBundle = bundleWWW.assetBundle;
if (assetBundle.isStreamedSceneAssetBundle) {
string[] scenePaths = assetBundle.GetAllScenePaths();
string sceneName = System.IO.Path.GetFileNameWithoutExtension(scenePaths[0]);
SceneManager.LoadScene(sceneName);
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612161835im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to load a scene from an asset bundle in unity 5? 1 Answer
Load AssetBundles and External Scenes dynamically 0 Answers
Loading assetbundle problem 1 Answer
Asset bundle (scene bundle) loading time is too much 0 Answers
Why does a scene loaded from an Asset Bundle returns empty string when getting its name? 0 Answers