I can't load a new scene
this is my code void OnTriggerEnter2D(Collider2D other) {
Debug.Log ("collision!", gameObject);
Destroy (enemy); // destroy works
Application.LoadLevel(1) // doesn't work !!!
}
this happen when its trigger and I already added to the build setting, so what im doing wrong????.
Scene 'GameOover' (-1) 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.Application:LoadLevel(String) destroy2:OnTriggerEnter2D(Collider2D) (at Assets/srips/destroy2.cs:16)
I am asking for an image where we see the Build Settings window
Answer by xyelenemuisc · Aug 14, 2017 at 02:11 AM
Application LoadLevel is deprecated use SceneManager Instead. SceneManager.LoadScene ("scenename", LoadSceneMode.Single);
Answer by 20Jay99San04 · Oct 24, 2017 at 10:59 AM
You have to add the scene you want to load in File~Build Settings.
Your answer
![](https://koobas.hobune.stream/wayback/20220612063102im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Scene view, objects disappear when i scoll to near. 5 Answers
Save timer score from different scenes 2 Answers
Default plane object display error. 0 Answers
Export Multiple Scenes 0 Answers