//Jimmy Vegas Unity Tutorial //This script will pause the game using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityStandardAssets.Characters.FirstPerson; public class PauseGame : MonoBehaviour { public bool Paused = false; public GameObject ThePlayer; void Update () { if (Input.GetButtonDown("Cancel")) { if (Paused == false) { Time.timeScale = 0; Paused = true; ThePlayer.GetComponent().enabled = false; Cursor.visible = true; } else { ThePlayer.GetComponent().enabled = true; Paused = false; Time.timeScale = 1; } } } }