How do I disable the default function of Unity that Escape brings up the mouse.
As when I press escape it pauses the game, Freezes the character and movement and brings up a paused UI if I press Escape againto exit the pause menu the mouse disapears for a breif second and then pops back up, I do gain access to the player again, but for some reason the cursor will continue to display the mouse regarless if I set Cursor.visable = false;
Current code that handles pausing the game.
if (isPaused && Input.GetKeyDown(KeyCode.Escape))
{
fpc.enabled = true;
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
pausedCanvas.SetActive(false);
isPaused = false;
}
else if (!isPaused && Input.GetKeyDown(KeyCode.Escape))
{
fpc.enabled = false;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
pausedCanvas.SetActive(true);
isPaused = true;
}