Search Unity

Fix for launch screen rotation issues

Discussion in 'Android' started by bpritchard, May 7, 2012.

  1. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Anyone have a way that we can, at launch, get the Launch Screens to ALWAYS be landscape? Currently whenever the project is launched on any android device and the hardware is sitting in the portrait position.. the app will attempt to scale the launch screen to fit in a portrait view. Its kinda annoying.. we've got all the rotation directions setup properly in the build settings.. just can't seem to get it to force itself into a direction on start.
     
  2. szi_John

    szi_John

    Joined:
    Feb 10, 2012
    Posts:
    70
    This should be in the player settings under screen orientation. Go to Edit -> Project Settings -> Player. Then in the inspector you may need to enable auto rotation but only select landscape left or right with everything else toggled off.
     
  3. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Correct.. i have those settings in place (and always have)... but the problem (specifically on android devices) is that whatever orientation the device is in Unity (at launch ONLY) assumes that direction. So we end up w/a splash screen thats rotated to portrait and scaled to fit the width of the device. really annoying.. and i can't seem to find anyway to force it to startup in landscape.
     
  4. HazeTI

    HazeTI

    Joined:
    Jan 12, 2012
    Posts:
    83
    This doesn't help solve the problem but I have found exactly the same thing. Also only on Android as iOS seems to work as intended. I had also tried asking in answers with no luck as to finding a work around. My assumption is that this is a bug within Unity itself.
     
  5. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    903
    Same problem here. Have either of you guys submitted a bug report yet? That's the only way it will get fixed.
     
  6. HazeTI

    HazeTI

    Joined:
    Jan 12, 2012
    Posts:
    83
    I have, over a month ago, but it has not been looked at yet as far as I can tell. It happens on the Angry Bot demo so I found it easier to send them a bug with that project rather than with our own. To be honest, this is fairly low on our list of problems with 3.5.x that we'd like fixed so I don't mind too much that it's not being looked at yet.

    We've got the default orientation set to Landscape left, to force it to start in landscape and then we set the Screen.orientation ourselves... something like:

    Code (csharp):
    1.  
    2. DeviceOrientation orientation = Input.deviceOrientation;
    3. if (orientation == DeviceOrientation.LandscapeLeft)
    4. {
    5.     Screen.orientation = ScreenOrientation.LandscapeLeft;
    6. }
    7. else if (orientation == DeviceOrientation.LandscapeRight)
    8. {
    9.     Screen.orientation = ScreenOrientation.LandscapeRight;
    10. }
    11.  
     
  7. Neverender-io

    Neverender-io

    Joined:
    Jun 12, 2013
    Posts:
    3
  8. betaalpha

    betaalpha

    Joined:
    Apr 28, 2013
    Posts:
    6
    Am I glad I found this thread! Antiuniverse's fix worked great for me.
     
  9. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Unity should automatically patch the android:screenOrientation attribute as long as you use the activities supplied with unity and don't roll your own. In an upcoming Unity version we will add a meta-data attribute which can be used to tell Unity which activities to patch.
     
  10. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    I have found this bug in my project and solved it successfully. There is no bug from unity side.

    I have checked my android manifest file and in that one of the manifest file contains wrong orientation.
    I have change it to correct one and everything works fine.
     
  11. SanSolo

    SanSolo

    Joined:
    Feb 25, 2014
    Posts:
    85
    Problem still exists. Unity 5.1.2. Landscape left. Game launches in portrait.
     
  12. Nyduss

    Nyduss

    Joined:
    Sep 17, 2015
    Posts:
    1
    I am having the same issues with Unity 5.1.2, as well as I cant change the app name by going into "PlayerSettings" and changing the "Product Name". Would love my app to be landscape only and the app name to change...
     
  13. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    As per my opinion, if you are using any third party plugins into your project then in those manifest file they have definitely specified orientation. Same I thing creating problem for you.
     
  14. drewt

    drewt

    Joined:
    Jun 10, 2013
    Posts:
    2
    This issue started occurring to me when I updated to Unity 5.4.0. After finding this thread, I did a search through my code and found that the android:screenOrientation tag was set to "portrait" a couple of times in my AndroidManifest. In all of those instances, I switched it to "sensorLandscape" as Antiuniverse suggested, and it fixed the problem for me. This was not happening in any previous versions (5.3, 5.2, etc), but I'm glad I found a fix.
     
  15. MetaDOS

    MetaDOS

    Joined:
    Nov 10, 2013
    Posts:
    157
    I have the same issue with Unity 5.4. Even I set sensorLandscape in Application and every Activity tag, the issue still exists. Please help.
     
    Greg00767 likes this.