basically I start off my game with the main menu (scene 0), all the code and buttons work and I’m able to click play and start my game in the next scene (scene 1). However the problem is that when its game over, I am transported back to the previous menu scene and I am unable to click on any buttons and unable to play again. any tips? my first time posting a thread and I’m pretty new to coding.
this is the game over script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameOver : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
SceneManager.LoadScene(0);
}
}
and this is my menu script with the play button
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour
{
public void PlayGame ()
{
SceneManager.LoadScene(1);
}
public void QuitGame()
{
Debug.Log("QUIT!");
Application.Quit();
}
}