- Home /
iPhone screen becomes dark while playing racing game
During the gameplay(car race), even though there is user interaction with the screen, the screen becomes dark after few minutes of gameplay(say 2-3 mins) and again get back to normal upon touching the screen, its a kind of user disruption Is there any solution, so that the iPhone screen will be in normal state, when user is intact with the screen?
Answer by Taiyib · May 21, 2010 at 06:55 AM
In script change iPhoneSettings.screenCanDarken to false. This basically does the same as:
//Objective-C call [UIApplication sharedApplication].idleTimerDisabled = YES;
It prevents the auto lock on iPhone to kick-in.
Answer by Richard 3 · Aug 16, 2011 at 02:46 PM
Use this for Unity 3.4 version.
http://unity3d.com/support/documentation/ScriptReference/Screen-sleepTimeout.html
Screen.sleepTimeout = 0.0f;
Thanks
Your answer
![](https://koobas.hobune.stream/wayback/20220612212708im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Iphone Loading Screen.....?? 1 Answer
black screen when simulating 1 Answer
android platform 0 Answers