This is the closest I've gotten:

                "t:SceneAsset " + MenuSceneName,
                new string[] { "Assets" }

However this generates an error at runtime:

InvalidOperationException: This cannot be used during play mode, please use SceneManager.LoadScene()/SceneManager.LoadSceneAsync() instead.

I can't follow its suggestion because those functions require the scene to be in build settings or an asset bundle. So, is there any other option?

I wonder how (and if) Addressables achieve this? Note: I'm not willing to switch to Addressables - I'm quite enjoying working with AssetBundles.


My game uses AssetBundles for general loading of EVERYTHING, so there's only one blank scene in build settings. However, during development I'd rather not have to continuously build and load from AssetBundles, so I'm trying to dynamically load scenes WITHOUT having to add them to build settings.


2 Answers 2


Turns out there's EditorSceneManager.LoadSceneInPlayMode which does exactly what I'm looking for! Awesome.

I had asked on the Unity Forum and found the answer there

  • \$\begingroup\$ Woah, nice! Must be a new feature. \$\endgroup\$
    – Ed Marty
    Commented Sep 17, 2019 at 6:55
  • \$\begingroup\$ Yeah the docs hint to Addressables, so it probably came around with that. Awesome stuff. \$\endgroup\$
    – Bilal Akil
    Commented Sep 17, 2019 at 7:53
  • \$\begingroup\$ Great, but does it work when you build your game? The documentation says "The use case for this is to emulate Asset bundles while loading scenes in play mode in the editor." and usually the Editor... classes and methods are stripped from the build. \$\endgroup\$ Commented Jul 9, 2020 at 6:07

Unfortunately, the only ways to load scenes are the two options you already mentioned. However, just because it’s in the list of scenes, doesn’t mean it needs to end up in the built game. There are two options here.

The first option is to manually uncheck the checkboxes in the build settings next to all of the scenes that you don’t want to include whenever you do a build. Simply click on scene 1, then shift-click on the last scene, and toggle any of the checkboxes.

The alternative is to write a small script which automatically modifies the build settings whenever you do a build. This shouldn’t be too difficult, but if you are not doing a lot of builds it may not be worth the effort.

  • \$\begingroup\$ I'm not sure how to have a script run when I do a build (and after the build completes to undo the action). Do you know how to achieve those? \$\endgroup\$
    – Bilal Akil
    Commented Sep 17, 2019 at 3:41
  • 1
    \$\begingroup\$ Actually that's not too hard, with I(Pre|Post)processBuildWithReport. Thanks! \$\endgroup\$
    – Bilal Akil
    Commented Sep 17, 2019 at 4:09
  • \$\begingroup\$ Turns out there's a (maybe new) method doing exactly what I need! See my answer \$\endgroup\$
    – Bilal Akil
    Commented Sep 17, 2019 at 6:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .