Scene 'Assets/First level.unity' (-1) couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
Hi guys, to day i crated 2 scenes, the first is 'First level' where is my robot and his adventure, and the second is 'MainMenu². where you can Start the Game, and Quit the Game. All was okey, i could start and play. But after, i crated an build settings, and after build it, i couldn't die, my restarter script didn't work. I checked everywhere on unity answer same problem, but i didn't find..
So the error message is: Scene 'Assets/First level.unity' (-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.SceneManagement.SceneManager:LoadScene(String) UnityStandardAssets._2D.Restarter:OnTriggerEnter2D(Collider2D) (at Assets/Standard Assets/2D/Scripts/Restarter.cs:13)
If you need more infos just ask me, Can you help me please? :(
Hi #Robertbu #Eric5h5 #Bunny85 #whydoidoit , i see that's you were good, and you explained nice to people, so i ask you to help me, i really want be a creator of game, but i have this problem and i can't continue, i tried so many hours, i search on youtube and forums, but nothing... :(
Answer by phyzikalgamer · Aug 31, 2016 at 09:45 AM
I may have misunderstood your question but try the following:
open build settings and drag your First Level scene into the the top section where your other scenes are. Locate the index number next to the scene name and put that number in your script.
Answer by s0urav · Jan 24, 2017 at 05:11 PM
Hi! If you are using SceneManager.LoadScene(Scenename); make sure you enter the name of the scene instead of entering the build number of your scene.
Answer by Twinklier · May 10, 2018 at 08:40 AM
uhhh... I've checked the spellings and that dorta things but it still doesn't work. It works when I build & run the game though, just not in the editor??