Search Issue Tracker
Fixed in 2022.2.X
Screen.orientation returns Landscape despite it being made obsolete
Screen.orientation returns Landscape when the orientation is set to Landscape Left. This is incorrect because ScreenOrientation.Landscape was made obsolete.
Steps to reproduce:
1. Open the attached project
2. Build for a mobile device of your choice
3. Attach a tool to verify console output - Screen.orientation reports Landscape.
Note: the attached project already has the Default Orientation set to Landscape Left. Make sure you have the same setting if you are not using the attached project.
Expected result: Screen.orientation is equal to ScreenOrientation.LandscapeLeft.
Actual result: Screen.orientation is equal to ScreenOrientation.Landscape
Reproducible with: 2021.2.0a16 and above
This is an undesirable result because we have made the ScreenOrientation.Landscape obsolete thus it's hard to use the resulting enum value from Screen.orientation in case it is needed.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- There are 38 extra AudioSources in the Scene
- Performing Android and iOS batch-mode builds causes error in RenderTexture
- Windows Player exe contains unwanted properties, causing text "Unity Playback Engine" to appear in task bar when mousing over it
- Changes made by the Script in the UI Document are reset when performing an Undo operation after changing the GameObject with this Script
- Emissive materials are broken when loading Scene via SceneManager.LoadScene