15
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Unity]LoadScene()でシーンが切り替わらない時の対処法

Last updated at Posted at 2018-03-25
void Start()
    {
        SceneManager.LoadScene("シーン名");
    }

からシーンを移動させようとしたが、

Scene 'シーン名' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.

このようにエラーが起きた。

よく見てみると、エラーの詳細に、

To add a scene to the build settings use the menu File->Build Settings...

と書いてある。
つまり、build settingsでシーンを追加するのを忘れているのだ。

build settings
ここの、Add Open Scenesでシーンを追加している状態でなければならない。

シーンを開いている状態でAdd Open Scenesをクリックすれば追加できる。

15
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?