- Home /
Cant seem to get portrait orientation with standalone app
My game has a resolution of 400x600, so it looks exactly like it will on an iphone.
Publishing to web player and flash player result in the desired portrait orientation, but when I publish to mac/pc standalone the resolution is only 720x480, im not worried about the increased resolution but it swaps the dimentions, resulting in a landscape view.
Is there any way to fix this?
Im having this problem too, Unity wont run in windows xp in vertical display.
I haven't had this problem yet, but I'm expecting to shortly...
$$anonymous$$y thought is to check the screen aspect ratio in a Start() function and if it's > 1 (width > height) adjust the camera's normalized viewport rect accordingly. $$anonymous$$ight need to adjust camera position and/or field of view as well, if it's not an orthogonal view...
Please post if you find an acceptable solution.
Answer by thekingofclubs · Sep 11, 2014 at 10:25 PM
This is an old question, but the problem occurred to me too so what I did was in Player Settings, under Standalone Player Options I unchecked "Default is Full Screen", unchecked "Display Resolution Dialog", unchecked all "Supported Aspect Ratios" except "Others" and set the Default Width and Height to 410 and 656 respectively. Then in my GameController which never gets destroyed until the user exits the game, I added this:
function Awake()
{
Screen.SetResolution(410,656,false);
}
I came up with 410 as the width like this: I know I want the height to be 656 and aspect ratio of 10:16(width:height). Therefore, width = height/1.6 = 656/1.6 = 410. A better solution would be to calculate the resolution based on the maximum resolution supported by the user's monitor that adheres to your target aspect ratio. This is explained by someone here.
Your answer
![](https://koobas.hobune.stream/wayback/20220613094235im_/https://answers.unity.com/themes/thub/images/avi.jpg)