- Home /
How can i get the right screen resolution on Android at application launch?
I have created a scene that has a unique gameObject, that has a script attached. The script simply get the Screen.width and Screen.height on Awake.
The problem is that when I launch the app on Android, I get the wrong resolution at first frames, while it outputs the right resolution later.
How can I solve that?
Thank you.
Answer by Bicko · Jul 16, 2012 at 04:35 PM
I think you need to get the screen info on Start, not Awake. Try that instead.
Yes, it works but it's really weird to me. $$anonymous$$ostly because I get the right screen resolution using a plugin that works with Android's Java.
Answer by Meltdown · Jul 16, 2012 at 05:48 PM
I had this same issue with a PC standalone game. Even on using Start it returned the wrong value. I had to use a co-routine to wait a little bit before the screen returned the right resolution.
Your answer
Follow this Question
Related Questions
Screen position out of view frustum error? 2 Answers
screen wrap bug, can't identify the issue 0 Answers
Unknown shape on screen (galaxy s4) 0 Answers
Turned screen 1 Answer
JS Class "Does not denote valid type" 0 Answers