- Home /
Screen sleep while playing game on Android
Hi,
I am preparing a small game with Accelerometer as a main input of my game. With this, my screen keeps on turning off while playing games. To overcome this I write following code,
void Start (){ Screen.sleepTimeout = SleepTimeout.NeverSleep; }
This seems working perfect but when I build and run this game on my android phone, it also keeps lights ON for menu and back key on phone. Is there any workaround for this? Or am I doing something wrong? Please advice.
Regards.
Your answer
![](https://koobas.hobune.stream/wayback/20220613182419im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Screen sleeping messes with my game. 0 Answers
After turning off Android phone screen, screen turns itself back on after a minute or so 0 Answers
Android game Screen turns off during gameplay 0 Answers
How do I reset Screen.sleepTimeout's user input timer? 1 Answer
Touch Hd screen drag problems 0 Answers