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

Can't disable portrait orientation in Windows Phone 8.1

Discussion in 'Windows' started by apparition, Oct 9, 2015.

  1. apparition

    apparition

    Joined:
    Jan 11, 2012
    Posts:
    116
    I feel like I've seen this discussed somewhere already but I can't find the thread now...

    I select "Landscape Right" and "Landscape Left" in Unity's player settings, build the game as a Universal 8.1 Windows Store app, and confirm in Package.appxmanifest that only "Landscape" and "Landscape-flipped" are checked. But when I test on a device and rotate the screen to portrait mode the game rotates with it.

    I've also tried adding this in MainPage's OnNavigatedTo:
    Code (CSharp):
    1. DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape | DisplayOrientations.LandscapeFlipped;
    I know there are orientation issues and limitations with the splash screen but I'm having this issue with the game itself.

    Any suggestions?

    I'm using Unity 5.2.0f3 and VS Community 2015.
     
    Last edited: Oct 9, 2015
  2. vladrybak

    vladrybak

    Joined:
    Aug 30, 2013
    Posts:
    108
    I have reported a bug about it. 733548 (Open) Orientation bug on windows phone/store
     
    apparition likes this.
  3. apparition

    apparition

    Joined:
    Jan 11, 2012
    Posts:
    116
    Good to know it's not just me. :)

    Hope this is fixed soon. I can't release my game with a broken portrait mode.
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,642
    Yes, it is a bug.
    There is a workaround however: call the code from the first post in this thread after Unity is initialized (say Awake method in script of your first scene).
     
    apparition likes this.
  5. apparition

    apparition

    Joined:
    Jan 11, 2012
    Posts:
    116
    Thanks Aurimas. I'll give that a try.