Screen.width and Screen.height inverted

Hey -

I am compiling a game on Landscape mode, and when I test on and iPad 3, the Screen.width is 2048 and the Screen.height is 1536. But if I test the same project on an iPhone 4, the dimensions are inverted. The Screen.width is 640 and Screen.height is 960.

Do I need to set something to get those values correct?

I did create a class to solve this issue that will find the bigger value and apply as the width, but I am using some libraries that uses Screen.height, so I kinda need a proper solution for that.

Thanks!
Sandro

I do not have ipad3 then cannot test it.

But it remembers me bug we got month ago from Unity’s update.

It is fixed in last updates.

Are you sure to run with the very last Unity version? (3.5.6f4)

We’ve encountered some strange things with Unity screen height and width. If your game always runs in landscape, you could program a check if height and width are not zero and check whether height is bigger than width. If that is the case, you could swap the values, just to be sure.

And make sure you’re using the latest latest version of Unity indeed.

We are not aware about such problem. Are you using Unity 3.5.6f4? If yes please submit a bugreport.
Thanks!

Also check if you detect Screen.width in Awake, Start or at variable declaration level.
When programming Gluddle we found that it sometimes took some seconds for screen.width or height to be reported correctly.

Thanks guys -
I am using Unity 4.0.0b7, and yes I am checking it on Awake method.
How can I submit a bug report?

I believe we already fixed this bug for Unity 4.0.0f2 (which is yet in release process), but if you see it with Unity 3.5.6f4 too, please submit a bug report!