How to hide cursor ingame? Please help
Hi, I'm trying to play Global Strike. When I put the game into full-screen, my mouse is still visible. I can only turn til the cursor hits the edge of my screen meaning I can't turn around or anything! I've never had this problem, hope there's an easy fix? Thanks for reading.
Answer by Dibbie · Nov 21, 2016 at 09:42 AM
Cursor.visible = false;
Cursor.lockstate = CursorLockMode.Confined;
Everything about "cursor" can be found here.
BUT be careful how you use this. While in the editor, you can always press Esc, to get your cursor back, but in your build, you may not have that option, so you would have to code a way to basically set the visibility back to true.
It's not working with: $$anonymous$$issingFieldException: UnityEngine.Cursor.lockstate
Answer by C_R_E_A_T_R_O_R · Jan 31, 2018 at 10:00 AM
is what you are looking for. This line hides the cursor and locks it in the middle of the scree during play mode.cursor.lockState = CursorLockMode.Locked;
Your answer
Follow this Question
Related Questions
Cursor.lockState not working on my pc, but the build works for others? 0 Answers
Trying to make the Cursor Invisible when a UI button is pressed 2 Answers
MouseOver 1 Answer
-force-openGL and -popupwindow work together? (Unity 3.5.7) 0 Answers
[Mobile] Prevent users from getting the full screen mobile call window 0 Answers