using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Pause_Menu : MonoBehaviour
{
public GameObject Settings;
public bool IfGamePaused;
public FPS_Cotroller FPS_Cotroller;
// Start is called before the first frame update
void Start()
{
FPS_Cotroller.canMove = true;
}
public void MainMenuButton()
{
// Show Main Menu
UnityEngine.SceneManagement.SceneManager.LoadScene("Main Menu");
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
Pause();
}
}
public void Resume()
{
FPS_Cotroller.canMove = true;
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
IfGamePaused = false;
Settings.SetActive(false);
Time.timeScale = 1f;
}
public void Pause()
{
FPS_Cotroller.canMove = false;
Cursor.lockState = CursorLockMode.Confined;
Cursor.visible = true;
IfGamePaused = true;
Settings.SetActive(true);
Time.timeScale = -0f;
}
}
Well, that’s not very clear is it. Not working doesn’t mean anything without more info.
But, I’ll toss out that you call Pause, but you never call Resume? idk, since you didn’t tell us what isn’t working, no clue.
Also: