I need to disable the mouse lock script when I return to the main menu so the cursor is unlocked and visible.
Here is the pause menu script i’m using
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class PauseMenu : MonoBehaviour {
public static bool GameIsPaused = false;
public GameObject pauseMenuUI;
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Escape))
{
if (GameIsPaused)
{
Resume();
} else
{
Pause();
}
}
}
void Resume ()
{
pauseMenuUI.SetActive(false);
Time.timeScale = 1f;
GameIsPaused = false;
}
void Pause ()
{
pauseMenuUI.SetActive(true);
Time.timeScale = 0f;
GameIsPaused = true;
}
public void LoadMenu()
{
Time.timeScale = 1f;
SceneManager.LoadScene("Main Menu");
}
public void QuitGame()
{
Debug.Log("Quitting Game...");
Application.Quit();
}
}
Now, I know what needs to be done but I DON’T KNOW HOW! simply telling the cursor to be visible doesn’t work. I need a way to disable the cursor lock script when the main menu loads, and I need to be shown where it goes because fun fact, not everyone here is ace scripting and some are beginners and being tossed a segment of script with no context is as unhelpful as not answering at all.
If you have an answer PLEASE show where in the script it goes.
It’s really an easy request. Ive been sitting on a finished game for a week now waiting for help with this problem so I can compile the damn thing and so far all Ive gotten is “you already know what needs to be done”. Literally like telling a lost person “you know where you want to go” and not giving them directions.