Unity Community


Results 1 to 4 of 4

  1. Posts
    11

    How to keep mouse cursor in the screen ?

    Hi guys,
    I builded a little sample game with first person shooter script. everything works well with it, and its windowed screen.

    I start the game and when the mouse goes of the screen the character turns too much.

    I want that the mouse cursor cannot go out of the screen. What is the way to do that ?

    Any help would be apreciatted...


  2. Posts
    10
    I tried hiding the cursor but it didn't work. The cursor can still go out of the window. Maybe the screen object can be helpful


  3. Posts
    7
    Try Screen.lockCursor. It also hides the cursor.


  4. Location
    Missouri
    Posts
    1,529
    Screen.lockCursor may be your only option in this case.
    Available for consulting:
    http://forum.unity3d.com/threads/960...Personal-Tutor
    http://www.unityprogrammer.com

    Just released The Farming Game: Software Edition, a remake of a popular board game. Check it out at the link below!
    http://thefarminggame.net/?ref=Pride

    For tutorials on how to use Unity go to my website at:
    http://www.unity-tutorials.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •