It sounds simple, but ever since Unity 5 rolled in everyone’s been giving me false information about
Application.LoadLevel WHICH IS OUTDATED
And now I’m stuck here with a half developed game, frusterated out of my mind thinking about scrapping this entire game because it’s entirely based on buttons!
Please… All I want is some clarification. All the tutorials are outdated. All the forums are too. I just want to change scenes on a button tap. All I require out of the veterans of Unity.
What errors are you getting and your current implementation?
From what I found across the interwebs is making sure you add the ‘using UnityEngine.SceneManagement;’ for Unity 5+. You can call the scene by name in the first example, or just increment your current buildindex if you have your flow sequentially.
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
public void GoToSceneThree()
{
SceneManager.LoadScene("scene_three");
}
public void NextScene()
{
Scenemanager.GetActiveScene ().buildIndex + 1;
}
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class YourClass: MonoBehaviour{
public void OnButtonClick(){
SceneManager.LoadScene("scenename");
}
}