Search Issue Tracker

Fixed in 2017.2.0f3

Fixed in 5.4, 5.5, 5.6, 2017.1



Found in


Issue ID




[iOS] Changing the screen orientation via a script sometimes results in corrupted view on iOS 10



When the orientation of the screen is changed via a script (with Screen.orientation) on iOS 10 devices, sometimes the screen remains in portrait orientation, but the game view gets flipped and goes over the edge of the screen and leaves black area in the bottom part of the screen.

Steps to reproduce:
1) Open the attached project.
2) Build 'MainScene' for iOS.
3) Run on an iOS 10 device.
4) Press the 'Switch to landscape' UI button.

If the button is clicked 2-3 seconds after launch - the rotation should fail - black area appears at the bottom of the screen, half of the game view is not visible. If it does not, quit the app completely, re-launch it and repeat step 5). This occurs with both Metal and OpenGLES on iOS 10.

Reproduced on:
5.5.0b5, 5.4.1p3, 5.3.6p6

iPhone 7 iOS 10 - reproduced
iPhone 7 iOS 10.1 - reproduced
iPhone 7 Plus iOS 10.0.2 - reproduced
iPhone 5 iOS 10 - not reproduced
iPad Mini 2 iOS 10 - not reproduced
iPhone 5S iOS 9.2.1 - not reproduced
It should also be reproducible on iPhone 6.
iPhone 6S iOS 10.2 - reproducible


Fixed in 2017.1.0b10, 5.6.2p1, 5.5.4p1, 5.4.5p4

Comments (96)

  1. 1ae1699ae39695d58ab96673619f0af8?d=mm


    Dec 18, 2016 06:16

    Unity, please increase the severity of this issue. The "workarounds" may not be the most user friendly or best fit into the game design.

  2. 295ca23f4db522bb1c3ec70ea042c0dc?d=mm


    Dec 17, 2016 23:01

    This is an absolutely abysmal bug - This is not fixed even in 5.5p1. The game crashes when unlocking your phone if you've gone into portrait mode. Iphone 6 with iOS 10 here. Run game which is landscape. Lock phone. Turn phone into portrait while locked. Unlock the phone and the game crashes. It doesn't crash if you keep your phone in landscape and unlock that way.

  3. 4b38dae05c4e294ee8362ec988231815?d=mm


    Dec 14, 2016 22:52

    I have noticed that the severity of this issue is 3, meaning "workaround is possible", which absolutely not the case.
    So please increase the severity of this issue, and fix it asap. It is really a terrible bug!

  4. 022c156d76ef8c3212a324c252fa9fbe?d=mm


    Dec 13, 2016 21:34

    None of the posted workarounds works for our situation, but we came up with one that does!

    Here's a link to the basics of our current workaround:

    Context: Our app starts in Portrait, has autorotate disabled, and we explicitly force LandscapeLeft upon loading a "level" -- this step of explicitly changing from Portrait to LandscapeLeft causes the bug to appear almost 50% of the time on iOS 10.

  5. 85916f2e42ab5a983e1943f37437c764?d=mm


    Dec 12, 2016 13:31

    Though, this causes wired auto rotation for our users when they bring our game front Background to Front, That's wired, and I dont know if Apple will reject our app because it behaves strange, just like a bug.

    Hope this bug would be fixed soon.

  6. 85916f2e42ab5a983e1943f37437c764?d=mm


    Dec 12, 2016 13:26

    Thanks to FSPARK's workaround, but the code will till crash our app.
    After digging in our game, I found the app only crashes in this situation:
    (Our game only supports landscape left and right)

    1. Open your game
    2. Get in any scenes which is somewhat complex.(Very simple scenes does not crash in our game)
    3. Lock your iphone.
    4. After ApplicationDidEnterBackground, unlock your iPhone with portrait orientation;
    5. Game crash.

    And with FSPARK's code, the app still crash when you set the device orientation to the same when you lock your iPhone. The screen do not auto rotate to wakeup Unity.

    So we changed the code a little, to always rotate the app to the opposite landscape, and the app does not crash any more. Here's the code:

    UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
    NSNumber *value = [NSNumber numberWithInt:UIDeviceOrientationLandscapeRight];

    if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft){
    value = [NSNumber numberWithInt:UIDeviceOrientationLandscapeLeft];
    }else if(interfaceOrientation == UIInterfaceOrientationLandscapeRight){
    value = [NSNumber numberWithInt:UIDeviceOrientationLandscapeRight];

    [[UIDevice currentDevice] setValue:value forKey:@"orientation"];

  7. 13db2970a528603271106a85e6e5a55f?d=mm


    Dec 08, 2016 20:33

    if you dont vote for it, it wont be fixed. Just commenting here doesnt help

  8. 022c156d76ef8c3212a324c252fa9fbe?d=mm


    Dec 08, 2016 17:40

    Unfortunately, we just got our first submission rejected by Apple over this.

    Since this issue has been around since iOS 10 shipped, I guess we will have to try FSpark's workaround!

  9. 5ba75621e96f1b44463991d93a933fe6?d=mm


    Dec 06, 2016 15:40


  10. D4b5154ffde92a67902bc4e8bc08a7f6?d=mm


    Dec 06, 2016 14:11

    Everyone please vote, don't just comments, there are only 9 votes left to raised this issue to Unity

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.