- Home /
Cursor.visible issues
I currently have multiple canvases - paused, win and died.
I need the cursor to be visible on these so buttons can be pressed - it works fine on the paused menu. when escape is pressed it pops up and the cursor becomes visible.
if (Input.GetKeyDown (KeyCode.Escape))
{
menuCanvas.SetActive (true);
Time.timeScale = 0;
Cursor.visible = true;
}
However, it does not work on either of the other canvases and I can not figure out why. This is the code for the end canvas:
void OnTriggerEnter (Collider other) {
endCanvas.SetActive (true);
Time.timeScale = 0;
CyberSoldier.GetComponent<FirstPersonController> ().enabled = false;
Cursor.visible = true;
}
The mouse will not show up here - any idea why? Sometimes it pops up for half a second the vanishes.
its possible you are taking input in update and input keeps your cursor invisible, when game ends stop input and your cursor became visible.
Your answer
Follow this Question
Related Questions
Script that makes the mouse cursor invisible. 3 Answers
add lockcursor to pause menu script?? 2 Answers
Hiding the cursor on a certain level. Pause Menu help. 2 Answers
Cursor not shown after changing scene 1 Answer
Pause Menu Audio 1 Answer