So i've found a script that changes to another level when triggered. There is a problem though. when i input the script it works but i get this yellow error at the bottom of my screen. Assets/Scripts/LoadLevel.js(8,21): BCW0012: WARNING: 'UnityEngine.Application.LoadLevel(String)' is obsolete. Use SceneManager.LoadScene. when i swap out the loadlevel with scenemanger.loadscene it gives me a red error saying this Assets/Scripts/LoadLevel.js(8,21): BCW0012: WARNING: 'UnityEngine.Application.LoadLevel(String)' is obsolete. Use SceneManager.LoadScene i dont like getting errors. this is the script when im getting the yellow errors. the script thats giving me the red error is the exact same but instead of Application.LoadLevel its SceneManager.LoadScene PS. The Code is in .js format. i dont know why it says csharp. Code (csharp): #pragma strict function Start () { } function OnTriggerEnter () { Application.LoadLevel("2"); } Please help. i can still play with the yellow errors but they're bugging me :/
That code will work fine, the yellow errors are usually not important. If you don't want to see them, you can hide them by clicking the yellow triangle in the Console. The reason you're getting that error is because there's the new SceneManager system: https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.html