AppSeedのアプリ開発ブログ

アプリ開発会社AppSeed(アップシード)開発担当のブログです。iOS、Android、Unity、Cocos2d-xなどアプリ開発関連のTipsや備忘録、アプリ開発に役立つ情報を発信します。

【Unity】画面遷移させようとした時に「build settings or the AssetBundle has not been loaded.」のエラーが出る場合の対処法

https://unity3d.com/files/images/ogimg.jpg?1

Unityでトップ画面からゲーム画面へ遷移させようとした時に下記のようなエラーが発生してしまいました。

Scene 'GameScene' 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...

UnityEngine.SceneManagement.SceneManager:LoadSceneAsync(String)

今回はこのエラーの対処法についてのメモです。

 

 

build settings or the AssetBundle has not been loaded.の対処法

 

エラーは、「Sceneがbuild settingsに追加されていない場合」に発生するエラーです。

このエラーの対処法はエラー内容に書いてある通り、

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

 

【Unity】画面遷移させようとした時に「build settings or the AssetBundle has not been loaded.」のエラーが出る場合の対処法

 Build Settingsで遷移先のSceneを追加すれば解決できます。

Unityでプロジェクトを作成すると、最初のSceneは初めからBuildSettingsに追加されているため、普通にビルドできますが、他のSceneに切り替えたい場合は、BuildSettingsで遷移先のSceneを追加しないと上記のようなエラーが出るようです。