Pausing game/Slowing it down in background of pause screen

Hey guys, I am doing a little project and was just wondering if/how I can pause a game behind a pause screen.

This is my interaction menu so far;

using UnityEngine;
using System.Collections;

public class InteractionMenu : MonoBehaviour {

    private bool pressed;

    private bool EscapeMenu;
    private bool Inventory;
    private bool Chat;

    public GameObject EscapeMenuObj;
    //public GameObject InventoryObj;
    //public GameObject ChatObj;

    void Start () {
        pressed = false;
        EscapeMenu = false;
        Inventory = false;
        Chat = false;
    }

    void Update () {

        //Escape Menu
        if (Input.GetKey (KeyCode.Escape)) {
            if (!pressed) {
                pressed = true; 
                if (!EscapeMenu) {
                    CursorLock ("Off");
                    EscapeMenu = true;
                    EscapeMenuObj.SetActive (true);
                } else {
                    CursorLock ("On");
                    EscapeMenu = false;
                    EscapeMenuObj.SetActive (false);
                }
            }
        } else {
            pressed = false;
        } 

        //Inventory
        if (Input.GetKey (KeyCode.E)) {
            if (!Inventory) {
                CursorLock ("Off");
                Inventory = true;
                //InventoryObj.enabled = true;
            } else {
                CursorLock ("On");
                Inventory = false;
                //InventoryObj.enabled = false;
            }
        }

        //Chat
        if (Input.GetKey (KeyCode.T)) {
            if (!Chat) {
                CursorLock ("Off");
                Chat = true;
                //ChatObj.enabled = true;
            } else {
                CursorLock ("On");
                Chat = false;
                //ChatObj.enabled = false;
            }
        }
    }

    void CursorLock(string Switch){
        if (Switch == "On") {
            Cursor.visible = false;
            Screen.lockCursor = true;
        } else {
            Cursor.visible = true;
            Screen.lockCursor = false;   
        }
    }
       
}

You have not shown your game’s script at all, but assuming all your moving stuff moves with reference to Time.deltaTime, you can adjust the game’s timescale from the default 1 to maybe 0.2 to slomo everything moving.

1 Like

Not sure if theres an easier/better way but thats how I do it most of the time.

Yeah, worked just as i needed it to, thanks