Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. 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.