Zoro165
Zoro165

Reputation: 31

Unity - The game scene does not change in the executable file

Actually, I am having a problem with the game I am creating. I have saved as standalone file with all the scenes open in the "build settings", but when I open the executable file the play button does not work in the main menu to start the game. Code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class CS_MainMenu : MonoBehaviour
{
    public void PlayButton() 
    {

        SceneManager.LoadScene("Level 1");
        Debug.Log("Game open");
    }


    void LevelButton()
      {
        SceneManager.LoadScene("Level 2");
      }

     void CreditButton()
       {
        SceneManager.LoadScene("Credits");
       }


    public void ExitButton()
      {
        Application.Quit();
        Debug.Log("Game closed");

      }

    //public void QuitButton()
    //{
      //  Application.Quit();
        //Debug.Log("Game closed");
    }

Upvotes: 0

Views: 440

Answers (0)

Related Questions