- Home /
 
 
               Question by 
               Winj42 · Jul 16, 2016 at 03:13 PM · 
                mouseprogrammingcursorfirst-personfirst person  
              
 
              Unity 5 Center Cursor
Hi!
I'm trying to lock the mouse on the center of the screen for a first person game, but Cursor.lockState isn't working. In Monodevelop it doesn't recognise the '=' sign in the line:
 Cursor.lockState = CursorLockMode.Locked;
 
              
               Comment
              
 
               
              Answer by MegaWave_ · Jul 16, 2016 at 07:15 PM
This worked for me:
 function Update () 
     {
        Cursor.visible = false;
        Cursor.lockState = CursorLockMode.Locked;
     }
 
              Your answer