Unity 4.5.5f4 iOS8 Screen orientation problem

Hi!

Just downloaded the latest Unity version (4.5.5f4) and I have the next issue with orientation on the iPhone (5,6 iOS 8.1)
When call ScreenOrientation.Portrait after autorotation and rotating device interface become in the wrong orientation.

I need different orientations in my application + autorotation some times. So to test this fiature I have created simple application with 2 buttons only. The first button calls Screen.orientation = ScreenOrientation.AutoRotation; The second calls Call Screen.orientation = ScreenOrientation.Portrait;

Steps to reproduce issue.

  1. Call Screen.orientation = ScreenOrientation.AutoRotation;
  2. Rotate device to Landscape (Interface become landscape, all is ok)
  3. Call Screen.orientation = ScreenOrientation.Portrait;
    Interface become portrait again, all ok.
  4. Rotate device to Portrait. Interface become landscape, but the latest command was portrait. This is the main issue.
  5. Call Screen.orientation = ScreenOrientation.Portrait; once more. Interface become landscape and stretched.
1 Like

Same problem here. But have not gotten a response on the unity team whether they have a quick fix or at the very least are working on this bug. It is really a game breaker.

Hello,

This problem should be fixed in 4.5.5p5. In any case, I’d still like to look into this specific case – could you please file a bug with a reproduction project (if not done already) and tell me the case number?

And 4.5.5p5 is already out: Download Archive

4.5.5p5 is much better than 4.5.5p4, Thanks! But it has issues too.

I have created new project in 4.5.5p5 and attached this script to camera object:

usingUnityEngine;
usingSystem.Collections;

publicclasstestRotation : MonoBehaviour {

voidOnGUI() {
if (GUI.Button(newRect(10, 10, 150, 100), “portrait”)){
Screen.orientation = ScreenOrientation.Portrait;
}
if (GUI.Button(newRect(10, 160, 150, 100), “landscape”)){
Screen.orientation = ScreenOrientation.LandscapeLeft;
}
if (GUI.Button(newRect(10, 310, 150, 100), “Auto”)){
Screen.orientation = ScreenOrientation.AutoRotation;
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToLandscapeRight = true;
Screen.autorotateToPortrait = true;
Screen.autorotateToPortraitUpsideDown = true;
}
}

}

When I press portrait button - all works good!
When I press landscape button - all works good too!
But after pressing landscape when I press Auto - autorotate doesn’t work, screen is landscape.

I have attached simple test project. Maybe I did something wrong…
Thanks!

1851056–118704–testRotation.zip (24.2 KB)

It seems this script works good:

usingUnityEngine;
usingSystem.Collections;

publicclasstestRotation : MonoBehaviour {

voidOnGUI() {
if (GUI.Button(newRect(10, 10, 150, 100), “portrait”)){
Screen.orientation = ScreenOrientation.Portrait;
Screen.autorotateToLandscapeLeft = false;
Screen.autorotateToLandscapeRight = false;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
}
if (GUI.Button(newRect(10, 160, 150, 100), “landscape”)){
Screen.orientation = ScreenOrientation.LandscapeLeft;
Screen.autorotateToLandscapeLeft = false;
Screen.autorotateToLandscapeRight = false;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;

}
if (GUI.Button(newRect(10, 310, 150, 100), “Auto”)){
Screen.orientation = ScreenOrientation.AutoRotation;
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToLandscapeRight = true;
Screen.autorotateToPortrait = true;
Screen.autorotateToPortraitUpsideDown = true;
}
}

}

Does this Screen orientation issue also happen with Interstitial Ads ?

We get this [image below] in both our regular app setup Landscape Left + Landscape Right and when I have test built Landscape Left only. We don’t do anything in code to change the ScreenOrientation within the game, we’re strictly a Landscape Only game. BUT once I see that Interstitial Ad sticking 1/3rd off the top of the screen, if I rotate the iPad to Portrait the ad adjust itself and looks 100% correct as if it was a Portrait Ad.

I tried v4.5.5p5 last night (Landscape Right+Left) and got the same result. Same result also happens with the Prime31 plugin & the Unity direct iAds methods. I’m hoping to find time to make a clean mini-project that just loads the iAds to rule anything else out, but I thought I’d ask here to see if others are seeing the same issue?

I have similar problem my game/app runs as portrait (app in unity) and landscape (in game)… but if on game I hit on/off button, then I get back to the app, the screen is put in a bad state (uptown or headlong)… I haven’t found the correct way to handle my case.