How to change a scene from a button

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.

Examples pulled from http://forum.unity3d.com/threads/unityengine-application-loadlevel-int-is-obsolete.372915/

using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;

public void GoToSceneThree()
    {
        SceneManager.LoadScene("scene_three");
    }

public void NextScene()
    {
       Scenemanager.GetActiveScene ().buildIndex + 1;
    }

@Pillowfighter9
Look at the documentation:

You can see on the top of the page information that you are looking for:
“Use SceneManager.LoadScene”

I hope that I helped :slight_smile:

You have to use Unity - Scripting API: SceneManager now

Something like this:

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
    
public class YourClass: MonoBehaviour{
    public void OnButtonClick(){
      SceneManager.LoadScene("scenename");
      }
    }