Quantcast
Channel: Answers for "How do I lock and then unlock the cursor using the same key?"
Browsing all 4 articles
Browse latest View live

Answer by supernat

It's probably a misunderstanding of the compiler of what you really mean. It probably thinks you mean this: (( Input.GetKeyDown (KeyCode.R) && wasLocked) == false) It's good practice to...

View Article



Answer by Addyarb

Try this: if(Input.GetKeyDown(KeyCode.R)){ screenLock = !screenLock; } if(screenLock){ Screen.lockCursor = true; Screen.showCursor = false; } else{ Screen.lockCursor = false; Screen.showCursor = true; }

View Article

Answer by supernat

It's probably a misunderstanding of the compiler of what you really mean. It probably thinks you mean this: (( Input.GetKeyDown (KeyCode.R) && wasLocked) == false) It's good practice to...

View Article

Answer by Addyarb

Try this: if(Input.GetKeyDown(KeyCode.R)){ screenLock = !screenLock; } if(screenLock){ Screen.lockCursor = true; Screen.showCursor = false; } else{ Screen.lockCursor = false; Screen.showCursor = true; }

View Article
Browsing all 4 articles
Browse latest View live


Latest Images