Keep the mouse cursor within the game window

How can I make it so that the mouse cursor within the game window so that the cursor won’t for example go into the other screen if you’re using dual screens? I do not want to use the Screen.lockCursor since I want to be able to use the mousepointer inside the game and not make it hidden and centered which you do with the lockCursor function.

try this. I have not tested this, but found it in a quick google search :slight_smile:

Cursor.lockState = CursorLockMode.Confined;

Word of caution though. If you have a player that switches back and forth into and out of your game, this might be a pain point.

Hope this helps,