Forum Discussion

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

Help needed. Prevent OS sleep.

Any advice on how to prevent an OS from going to sleep for any of that make VR games that don't require input from a keyboard / mouse / controller. I can't exactly tell the player to change their power profile.

5 Replies

Replies have been turned off for this discussion
  • Well you should, because there's no easy way for that. Not in unity.
  • drash's avatar
    drash
    Heroic Explorer
    On Windows, the solution I think is to send some bogus mouse input using SendInput, but I have no idea how to do this in a cross-platform way. Really good question!
  • I just tested this on Winodws 7, and there seems to be no problem. I set sleep to kick in after 1 minute. Then I opened Tuscany Unity and left my desk. Even after a few minutes, the machine did not go to sleep. It appears having a full-screen game running prevents sleep mode.
  • "cybereality" wrote:
    I just tested this on Winodws 7, and there seems to be no problem. I set sleep to kick in after 1 minute. Then I opened Tuscany Unity and left my desk. Even after a few minutes, the machine did not go to sleep. It appears having a full-screen game running prevents sleep mode.


    Windows is giving me a completely different issue. Any notification (updates for Java, steam, anything) minimizes the Unity build (always freaks me out).

    I'm still diving into how to address these oddities.