Pause Menu Help
So, I followed this guide (https://www.youtube.com/watch?v=Wrelb5WBnoQ&ab_channel=gamesplusjames) and did every thing he did, but put in ‘Quit game’ instead of ‘Quit to Menu’ as I don’t have a main menu. About 15 minutes in to the video he drags the canvas in to a thing called ‘Pause Menu Canvas’ in his Pause Menu hierarchy. My problem is that I can’t see ‘Pause Menu Canvas’ or ‘Is Paused’. I have no idea what to do. Here’s my script: using UnityEngine; using System.Collections; public class PauseMenu : MonoBehaviour { public string levelSelect; public string quitGame; public bool isPaused; public GameObject pauseMenuCanvas; // Update is called once per frame void Update () { if (isPaused) { pauseMenuCanvas.SetActive (true); } else { pauseMenuCanvas.SetActive (false); } if (Input.GetKeydown (KeyCode.Escape)) { isPaused = !isPaused; } } public void Resume () { isPaused = false; } public void LevelSelect () { Application.LoadLevel (levelSelect); } public void Quit() { Application.LoadLevel (quitGame); } }
$$anonymous$$y script again, but easier to see :) :
using UnityEngine; using System.Collections;
public class Pause$$anonymous$$enu : $$anonymous$$onoBehaviour {
public string levelSelect;
public string quitGame;
public bool isPaused;
public GameObject pause$$anonymous$$enuCanvas;
// Update is called once per frame
void Update () {
if (isPaused)
{
pause$$anonymous$$enuCanvas.SetActive (true);
} else {
pause$$anonymous$$enuCanvas.SetActive (false);
}
if (Input.Get$$anonymous$$eydown ($$anonymous$$eyCode.Escape))
{
isPaused = !isPaused;
}
}
public void Resume ()
{
isPaused = false;
}
public void LevelSelect ()
{
Application.LoadLevel (levelSelect);
}
public void Quit()
{
Application.LoadLevel (quitGame);
}
}