- Home /
Android Screen.width/height giving weird results (212,377)?
I'm starting out Android development, with my HTC M8 connected to Unity via Unity Remote 4. I'm getting some weird results for Screen.width / Screen.height. It's giving me (212x317) when I try to force Game resolution (in Game view) to 1080x1920 (resolution of my M8). When I use free aspect the game window reads 1080x1776, but screen size is reading (229 x 377). That is really weird to me, even though it's giving me decimal point precision...
Also, I notice that the world resolution doesn't go past 1 decimal. So I would sometimes move my touch position by .1, but the world position when I do Screen to world point doesn't change. Is there anything I can do to compensate that?
I think Unity Remote is not a true estimation as its a Pseudo-run rather than a deployment.
Run your app on device and throw the screen size out to the GUI to see what it says there.
All I know about that is, that you get a scaled version of the game window on your Unity 4 Remote App Screen. While adjusting it you should see it changing quality of rendered objects. $$anonymous$$y guess is, Screen.width and height in this case return the maximum resoluted version of the streamed image (I think, what the USB cable can do).
I never had problems with a ScreenToWorldPoint of either touch or mouse. Decimal precision could be clamped because that's the default for Debug.Log (if that's what you're using);
Ah!! Clamped in Debug.Log! Thanks for letting me know :)
Your answer
Follow this Question
Related Questions
I can't change the sprite using the Touch class 0 Answers
Touch Input madness 2 Answers
Three finger tap? 1 Answer
Processes two touches instead of one 0 Answers
How can I tell if the device I am on supports touch? 4 Answers