I want to cursor be visible on pressing "2" key, I tried every script from internet, the only thing it worked is to make FirstPersonController dissabled, but that doesn't show me a cursor.
function Update () {
if(Input.GetKeyDown(KeyCode.Alpha2)){
GetComponent(FirstPersonController).enabled = false;
Cursor.lockState = CursorLockMode.None;
}
}
(this script is attached to player)
↧