Hi there, this is my first time posting here so please forgive me if I’m doing something wrong.
I’m currently making a pause menu for my game. I have four buttons; Resume, Restart, Main Menu and Exit. I have code for all four and it looks to me like it should be working.
using UnityEngine;
using System.Collections;
public class pauseMenu : MonoBehaviour {
public GameObject pauseUI;
private bool paused = false;
void Start(){
pauseUI.SetActive(false);
}
void Update() {
if(Input.GetButtonDown("Pause")){
paused = !paused;
}
if(paused){
pauseUI.SetActive(true);
Time.timeScale = 0;
}
if(!paused){
pauseUI.SetActive(false);
Time.timeScale = 1;
}
}
public void Resume(){
paused = false;
}
public void Restart(){
Application.LoadlLevel(Application.LoadedLevel);
}
public void MainMenu(){
Application.LoadLevel(0);
}
public void Quit(){
Application.Quit();
}
}
However, when I try to run the game in Unity I get this error:
“Assets/Scripts/pauseMenu.cs(43,29): error CS0117: UnityEngine.Application' does not contain a definition for
LoadlLevel’”
There is something wrong with the Restart button code but I do not know what.
Any help would be appreciated.