I’ve problem using
Cursor.Lockstateand
Cursor.visible
here is the full code:
if (Input.GetKeyDown("e")) { InventoryStat = !InventoryStat; if (!InventoryStat) { Cursor.lockState = CursorLockMode.None; Cursor.lockState = CursorLockMode.Confined; Cursor.visible = true; INV.gameObject.SetActive(true); } else { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; INV.gameObject.SetActive(false); } } When i press "e", the gui appears. but the mouse appears for one second and then instantly disappears. but when unlock the mouse with escape, it now wont disappear when pressing "e". I have searched the entire internet for this problem but i cant find anything. any help appreciated!