Unity 5 UI button won't change scenes?

Hi, I don’t know if this was asked before, if so, I haven’t found the answer.

I’ve been trying to make a play button that changes the scene from the main menu to the level select screen. I’ve tried tons of different scripts, but they were all obsolete as they worked for only 4 .6 and earlier.

Are there any solutions to this? Whenever I click the button, nothing happens.
Thanks for any help.

HI,

Please add patch to your unity . This might help. Link is shared below
https://unity3d.com/unity/qa/patch-releases

make sure the scene you’re trying to load is Checked in the Build Settings, and yes try Unity5.x

you can refer this video, it is unity 5. I try this so hard too, hope can help you too.

video link

here, I briefly show the script,

  1. drag the script to main camera

  2. create new scene

  3. add all your scene in path

  4. create UI button

  5. in the button’s inspector there, add the object main camera

  6. add function to it

  7. done

  8. you can do it too… xixi… Ep. 2 : Clickable Button to change scene - Unity 5.5 tutorial for beginner - YouTube

    using Unityengine;
    using System.Collections;

    public class MenuScript : MonoBehaviour
    {
    public void ChangeScene(string sceneName)
    {
    Application.LoadLevel(scenceName);
    }
    }

Unity Now uses SceneManagement to change Scenes.

using UnityEngine;
using UnityEngine.SceneManagement;
    
    public class UISceneChange : MonoBehaviour
    {
        public void ButtonClick()
        {
            SceneManager.LoadScene("SceneName");
            //Or index in Player Build
            SceneManager.LoadScene(0);
        }
    }