Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Unity iOS never go into sleep mode (iPad/iPhone)

Discussion in 'Scripting' started by saifshk17, Nov 20, 2019.

  1. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    Is there a script to make sure that the iOS device never goes into sleep mode when Unity application is running?

    The below piece of code works for Android devices but not for iOS:
    Code (CSharp):
    1. Screen.sleepTimeout = SleepTimeout.NeverSleep;
     
  2. JayneMcD

    JayneMcD

    Joined:
    Feb 23, 2022
    Posts:
    1
    In case anyone is wondering, the above does actually work on iOS. I had mine in void Start() when I load a scene in Unity and it works.