So im trying to make a crafting menu, and when i open it the mouse must be visible so i can click buttons with it but it doesn’t work it just flickers.
Here is the code:
void Update () {
if (Input.GetKeyDown (KeyCode.Escape)) {
Pause ();
}
if (Input.GetKeyDown (KeyCode.I)) {
Crafting_menu ();
}
}
public void Pause()
{
if (menu_pause.gameObject.activeInHierarchy == false) {
menu_pause.gameObject.SetActive (true);
Time.timeScale = 0;
//Cursor.visible = true;
Player.GetComponent<FirstPersonController> ().enabled = false;
} else {
menu_pause.gameObject.SetActive (false);
Player.GetComponent<FirstPersonController> ().enabled = true;
Time.timeScale = 1;
//Cursor.visible = false;
}
}
public void Crafting_menu()
{
if (craft_menu.gameObject.activeInHierarchy == false) {
craft_menu.gameObject.SetActive (true);
Cursor.visible = true;
} else {
craft_menu.gameObject.SetActive (false);
Cursor.visible = false;
}
}
}