Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Anonymous's avatar
Anonymous
11 years ago

Struggles with mouse clicking outside of program window

If I'm in Extended mode and I run a Unity DirectToRift app that requires clicking the mouse, I frequently have trouble with the mouse clicking out of the program window, causing the Rift view to freeze until I click back on my program by moving the mouse over to the Rift and clicking.

It doesn't seem to happen all the time or with all apps (or in Direct Mode, that I've seen)- so I'm wondering why the inconsistency. Is there a Unity setting maybe?

1 Reply

Replies have been turned off for this discussion
  • bilago's avatar
    bilago
    Honored Guest
    This needs to be programmed in the game itself to disable the cursor or confine it to the borders of the game window.

    Unity 5:


    Cursor.lockState = CursorLockMode.Confined;
    Cursor.lockState = CursorLockMode.Locked;
    Cursor.visible = false;


    Pre Unity 5:
     Screen.lockCursor = true;