Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

iOS Landscape Orientation Launching upside down - Unity 5.2.1

Discussion in 'iOS and tvOS' started by mpaxman, Oct 2, 2015.

  1. mpaxman

    mpaxman

    Joined:
    Oct 2, 2013
    Posts:
    10
    When building a simple Unity 5.2.1 project for iOS deployment we set the default orientation to auto rotate and then allow both landscape left and landscape right. When launching the app with Xcode the app will always start in landscape left which means if the player is holding it in landscape right it appears upside down at first and then flips over after a brief moment.

    Is anyone else seeing this? We've tried it with a brand new project and still get the same results. If both landscape modes are supported (no portrait) it always defaults to just one of them no matter which way it's being held at launch.

    We're using the most recent version of Unity (5.2.1), the most recent version of Xcode (7.0.1), and are running on OS X El Capitan.

    Any help?
    Thanks
     
    MrEsquire likes this.
  2. Arbuzas

    Arbuzas

    Joined:
    Mar 30, 2014
    Posts:
    2
    Yeah, same here. Have no clue how to fix. I _think_ it started @5.1 version.
     
  3. yakandco

    yakandco

    Joined:
    Dec 3, 2014
    Posts:
    90
    We've got even worse bugs - the launch screen image displays correctly to start with and then rotates 90 degrees the wrong way showing the landscape image cut off. There's a rolling thread on it all here.
     
  4. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Please submit a bugreport.
    Thanks!
     
  5. SimteractiveDev

    SimteractiveDev

    Joined:
    Jul 9, 2014
    Posts:
    97
    Hey, I am also experiencing this issue and have logged a bug report as I was unsure if the previous posters logged one and I couldn't find any on Issue tracker.

    I have found a temporary fix however, disabling "Use Animated AutoRotation" fixes the issue, although you can see the app in the wrong orientation briefly before it correct's itself. This obviously is not ideal as you do not have the nice animated rotation affect that users would be accustomed to.
     
  6. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I have similar issue or same issue with 4.6.9: http://forum.unity3d.com/threads/iphone6-unity-4-6-9-splashscreen-issue.360944/
     
    Last edited: Oct 22, 2015
  7. SimteractiveDev

    SimteractiveDev

    Joined:
    Jul 9, 2014
    Posts:
    97
    Nope, it's occurring on iPad Air and iPad mini for us, although our testers are saying it's happening on all iPad devices, but I cannot confirm this. Our app is iPad only, so have not tested on an iPhone.
     
  8. akeplinger

    akeplinger

    Joined:
    Oct 26, 2008
    Posts:
    57
    Happening for me too.
     
  9. mpaxman

    mpaxman

    Joined:
    Oct 2, 2013
    Posts:
    10
    So since the problem existed in a completely new empty Unity project as well I decided to start going in and debugging Unity's code from within Xcode. I came across some worrying TODO comments in some of the code. SplashScreen.mm has a "TODO: implement on iPads." Hmmmmmm.... doesn't sound good right. Then a little further down there's "FIXME: check on iPad" (currently I'm on Unity 5.2.2f1 and this line is at SplashScreen.mm line 289) I found that if I comment out the FIXME line then the problem of starting upside down goes away. Only problem is that the splash screen is just black at first. Seems like the lesser of two evils though, so that's what I've been doing. Hopefully Unity addresses these TODOs and FIXMEs soon. :p
     
    MrEsquire and Sebrofjr like this.
  10. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Thanks for the information, then they should have really shared this in the release notes as a KNOWN ISSUE.
    Did you change this within Xcode once Unity made a build?
     
  11. Sebrofjr

    Sebrofjr

    Joined:
    Oct 1, 2014
    Posts:
    24
    @mpaxman Thanks for the find. Commenting this out in our projects seems to have resolved the issue with no side effects. This was for apps with forced landscape, would still need to test in different scenarios.

    @MrEsquire I edited SplashScreen.mm directly in xCode.

    //_canRotateToLandscapeRight = false; // FIXME: check on iPad
     
  12. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I checked the code for 4.6.9 Unity and found no comments.
    Code (CSharp):
    1. - (void)updateOrientation:(ScreenOrientation)orient
    2. {
    3.     bool orientPortrait  = (orient == portrait || orient == portraitUpsideDown);
    4.     bool orientLandscape = (orient == landscapeLeft || orient == landscapeRight);
    5.  
    6.     bool rotateToPortrait  = _canRotateToPortrait || _canRotateToPortraitUpsideDown;
    7.     bool rotateToLandscape = _canRotateToLandscapeLeft || _canRotateToLandscapeRight;
    Is this something? The good news is that we dont maybe need to wait for patch and if developers provide hotfix manually edit..

    EDIT: I also can confirm that the splash screen is upside down and wrong orientation also.
    Upgraded to iOS 9.1 and tested on iPhone 4s and iPhone 6. Initially thought was just iPhone 6 + issue. I'm pretty sure some Xcode needs tweaking.

    Can a developer respond please!
     
    Last edited: Oct 22, 2015
  13. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    BUMP.. still need urgent fix...annoys me that this is low priority!
     
    georgepiva likes this.
  14. SimteractiveDev

    SimteractiveDev

    Joined:
    Jul 9, 2014
    Posts:
    97
    If the above edits are not applicable for you, have you tried disabling "Use Animated AutoRotation" in the player settings? Not ideal, but if it's blocking you from releasing, worth the compromise I'd imagine.
     
  15. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Thanks dude for the idea, tried it and made no difference..iPad Mini original one no issue present, iPhone 6, issue is there. So its not restricted to all devices..
     
    SimteractiveDev likes this.
  16. Sebrofjr

    Sebrofjr

    Joined:
    Oct 1, 2014
    Posts:
    24
    @MrEsquire I should have mentioned that we are using Unity 5.2.1p4 w/ xCode 7.0

    We also saw after testing yesterday that this fixed this issue on iOS8 iPad3, but it introduced a weird squish/flicker at the start of the splash screen on iOS9 iPad Air2.
     
  17. georgepiva

    georgepiva

    Joined:
    Dec 16, 2013
    Posts:
    14
    Same issue here! Can't publish game updates because of this problem...
     
    MrEsquire likes this.
  18. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    anyone filed bug reports? not sure whats going on usually developers monitor this forum
     
  19. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    This bug has been fixed; the fix is expected to be in the next patch release.
     
    SimteractiveDev likes this.
  20. sergi-gil

    sergi-gil

    Joined:
    Oct 29, 2015
    Posts:
    9
    @povillas can you provide the final splashscreen.mm for using it, until the next patch release is online?
     
  21. DimensionU

    DimensionU

    Joined:
    Aug 1, 2013
    Posts:
    43
    Did this make it in to 5.2.2p2? I don't see its mention in the release notes. Did I just miss it? This is blocking our release.
     
  22. sergi-gil

    sergi-gil

    Joined:
    Oct 29, 2015
    Posts:
    9
    I did a build with 5.2.2p2 and from xcode I opened SplashScreen.mm and it contains TODOS, FIXES comments as it was doing 5.2.2.p1.... I think this patch not fixing Splah Screen problems?
     
  23. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Its not in this patch release, we still need to wait but not sure till when!
     
  24. sergi-gil

    sergi-gil

    Joined:
    Oct 29, 2015
    Posts:
    9
    ok... keep waiting
     
  25. rocket5tim

    rocket5tim

    Joined:
    May 19, 2009
    Posts:
    242
  26. sergi-gil

    sergi-gil

    Joined:
    Oct 29, 2015
    Posts:
    9
    for me with 5.2.2p3 is still not working...
     
    georgepiva likes this.
  27. georgepiva

    georgepiva

    Joined:
    Dec 16, 2013
    Posts:
    14
    Same issue here. 5.2.2p3 didn't fixed the problem (at least for the iPhone 6 Plus).
    As a workaround, I am commenting out the next lines from `SplashScreen.mm`:
    Code (CSharp):
    1.  
    2. // launch screens always use landscapeLeft in landscape
    3. //    if (isIphone && _usesLaunchscreen && _canRotateToLandscapeLeft)
    4. //        _canRotateToLandscapeRight = false;
    5.  
    Do somebody have any other suggestions?
     
    Last edited: Nov 23, 2015
  28. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Same on my iPads. Games all start upside down, so can't issue any updates to my stuff for IOS. It's been broken since 5.1 so come on Unity pull your finger out please. Such an obvious bug surely proves there is no IOS testing going on prior to releasing patches.
     
  29. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Exactly that - NO TESTING. Not even talking about patch, what about main releases...
    I sent mail to one of the developers..I'm annoyed at whats happened and the fact that this is a SHOW STOPPER issue, cannot release my games without this fix...and have to wait two weeks for this patch and when finally out does not work..Annoys me why this is not being fixed in the mean time we have features for iOS9.1 that no one is using yet being developed..its strange how we dont see QA in forums now, attitude stinks, yet they keep trying produce fancy figures of how many things get fixed all the time!
     
  30. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    To be sure that we are looking into same issues as you, please re-post your case numbers.
    Thanks!
     
  31. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Please reboot the devices and delete apps, or even better -- change bundle identifier (for testing of course). It seems that many of the issues are caused by iOS caching launch screen images in some way.

    In particular, we could not reproduce the following issues:
    - Incorrect landscape orientation on iPad when only landscape orientations are allowed.
    - Incorrect splash screen orientation when legacy launch images are used on iOS 9.1.

    The following issue has been reproduced and will be fixed in the next patch release:
    - Incorrect landscape orientation on iPhone 6+ when only landscape orientations are allowed. A work around is to find `if (isIphone && _usesLaunchscreen && _canRotateToLandscapeLeft)` code in the Classes/UI/Splashscreen.mm file and replace isIphone with _isOrientable. Iphone 4 and 5 will still have incorrect orientation due to bug in iOS or Xcode.

    We could not reliably reproduce the launch screen squashing issue. It might be related to the launch screen caching. We will post more information.
     
  32. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    It's not just the splash screen but the whole app that's upside down. If you shake the iPad it then rotates to the correct way up.
     
  33. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    We tried exactly this scenario, but couldn't reproduce with patch 3.
    Could you please verify you are on 5.2.2 patch 3 and add iPad model + iOS version you tested on.
    Thanks!
     
  34. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    I've just installed 5.2.2P3 and it fixes the IOS orientation problem on my devices. Just for reference it was an iPad Air 1 with IOS 8.4.1
     
  35. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    With regards the launch screen squashing issue - we were able to reproduce the issue on some devices. It seems that this is iOS bug. Currently we have no timeline for a fix. The workaround is to delete "ViewP" item in Launchscreen-iPhone.xib file. "ViewP" itemis under the "View" item which is by default not expanded.
     
  36. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    On some devices -> well if you read the threads you know clearly told you to test on Iphone 6, iOS 9.1
    Why was it so hard, of course Im going to give you negative feedback as the way this issue is being handled at such a slow pace..

    But on positive side, you managed to reproduce it and now you can see that the issue does indeed exist.
    Just one more problem left now- see other thread..
     
    arkon likes this.
  37. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    The issue is more complex, not all physical devices reproduce the issue and even then, minor configuration changes make the issue to appear in different ways. Please do not expect bugs to be reproducible equally well on other setups. It may just be that there the issue depends some cached thing that is left over from previous app installation or previous iOS version and some devices are less lucky than others.

    What would have really helped the bug resolution process was a repro project which we did not receive. At least, with a repro project and non-reproducible issue we know that the problem is within iDevice configuration, not that the project setup is wrong.
     
  38. Anshar-Studios

    Anshar-Studios

    Joined:
    Nov 14, 2013
    Posts:
    1
    Funny case - if I Change the order of Landscape settings in my projects plist so that (left home button) is first - the splash screen starts in correct orientation. Unfortunately during engine initialization orientation is set back to upside down and then animates back to the correct rotation. Unity 4.6.9 on iPhone 5 with iOS 9.1.