Search Issue Tracker

Fixed

Fixed in 2021.3.28f1, 2022.3.4f1, 2023.1.2f1, 2023.2.0a19

Votes

12

Found in

2021.3.15f1

2022.3.0f1

2023.1.0a25

2023.2.0a14

Issue ID

UUM-23251

Regression

No

[iOS] Screen.orientation returns wrong values when switching from Landscape orientation to AutoRotation at runtime on iOS 16

--

-

Steps to reproduce:
# Open attached project (ScreenOrientationTest.zip)
# Switch target platform to iOS and make a build
# Open Xcode project and build to an iPhone
# Click "Landscape Left" or "Landscape Right" buttons to switch to one of these orientations
# Click "AutoRotation" and select all 4 allowed orientations
# Notice that orientation is immediately returned as "PortraitUpsideDown" while device is actually in portrait (not 100% of the time)
# Try rotating the device

Expected result: Orientations are reported correctly as you rotate the device.
Actual result: Orientations are flipped:
- when in Portrait orientation, app reports PortraitUpsideDown
- when in Landscape Left, app reports LandscapeRight
- when in Landscape Right, app reports Landscape or LandscapeLeft

Note: This doesn't reproduce if you switch to AutoRotation from a forced Portrait orientation.

Reproduced with: 2021.3.15f1, 2022.2.2f1, 2023.1.0a25

Devices tested:
iPhone 14 Pro Max, iOS 16.0 - Reproducible
iPhone 12 Pro, iOS 16.2 - Reproducible
iPhone 12 Pro, iOS 15.0 - Not reproducible
iPhone X, iOS 14.4.1 - Not reproducible
iPad Air 2, iOS 14.4.2 - Not reproducible
iPad Air 2, iOS 15.4.1 - Not reproducible

Comments (7)

  1. YousafGrewal

    Jan 09, 2024 11:05

    Still facing this issue in january 2024

  2. cat_woods

    Aug 25, 2023 09:31

    NOT FIXED!!! Enabling auto-rotation after entering the game, killing the process, and immediately entering the game again. Unity version 2021.3.28f1. iPhone 11 iOS 16.6

  3. JoJoJoX

    Jul 28, 2023 02:57

    Any body reproduces the bug in the releases that declaring bug-fixed?

  4. takatori_unity

    May 08, 2023 08:33

    I encountered the same issue with Unity 2020.3.37f1. The problem has been reported on iPhone 13 devices. In my case, even though I've only allowed Portrait orientation, the screen can still be rotated to Landscape.

  5. Pavel_989

    Apr 13, 2023 08:56

    We have an issue with IOS 16. On a quick restart, the app may start in a different orientation than the setting in the project.

  6. nhannguyen2gl

    Mar 16, 2023 09:05

    Same issue on Unity 2021.1.15 to 2021.1.21
    My app is in LandscapeRight but the ScreenOrientation is Landscape?! (not in ScreenOrientation enum)
    And when it's portrait, the value is PortraitUpsideDown

  7. kyubuns

    Mar 10, 2023 02:48

    I am suffering from a problem in iOS16 where games can be run in Orientation that I have not authorized. (Occurs occasionally.)
    Could this bug be the cause?

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.