Setting the “Default Orientation” to anything but “Auto Rotation” should work.
“Auto Rotation” + checking only a single box in the list of “Allowed Orientations for Auto Rotation” should also work.
Worked for me on the Google Pixel (Unity version is roughly current 2017.1 beta). If it doesn’t work then please report a bug so that our QA can have a look.
Ok I see now, if I set to Auto Rotation, it appears. Dumb UX on Unity’s part to be honest. You’d think if you select Landscape, it will force landscape.
Choose “Auto Rotation”, then “Allowed Orientations for Auto Rotation” will appear. Select both “Landscape Right” and “Landscape Left” checkboxes there.
Which Unity version do you use? On which device have you tried this? Have you tried on multiple devices? Try a new empty project, maybe you have a custom manifest in your project or some plugins modify the behavior.
2020.1.24 (will try on 25 as it released, I know it’s alpha)
OnePlus 6 with OxygenOS 10.3.1 / Android 10
Only have one device, but I sent the game to a friend and he couldn’t aswell
I never touched anything in the manifest (I’m never doing mobile, wanted to try and experiment a bit) and have no plugins on the project.
Is URP, new input system or some Unity package known to introduce this behaviour ? If not, is there any other settings than the ones I posted above in the PlayerSettings ?
I am not aware of any packages that would introduce this behavior. The only things that come to my mind are:
Maybe you are setting a fixed orientation in your scripts? For example setting Screen.orientation to landscape right in the script would overwrite the autorotation setting in the editor and it wouldn’t rotate anymore.
Maybe the autorotation is disabled in the Android OS settings on the device? That setting was not preventing rotation changes before, but I’ve heard recently, that on some Samsung devices with Android 10 disabling OS autorotation would prevent Unity to autorotate as well. Maybe that is happening on your device as well?
Nope, not touching anything in that. I even tried to manually allow Screen.autorotateToLandscapeLeft/Right to true in script, but it doesn’t do anything either.
I indeed have a button to toggle autorotation, but it is set to true, and other apps are rotating normally
Well, the easiest thing to try is to create a new empty project, set autorotation to the same values as in another project and check if it autorotates or not. If it does - then there must be something with the configuration of the project. If it does not rotate even with an empty project - please report a bug.
But this is what I did, I created and built this projet within the same day (basic flappy bird-like) just to experiment. I’ll try with default package, and with the ones I have and report
On a default project (URP template), without touching anything else than unchecking both Portrait in AutoRotation, it does rotate on my phone.
I though about what could cause the issue, because I had a similar thing happening for desktop. Some datas from PlayerPrefs regarding screen position / size where saved in PlayerPrefs and set back without any code from my side.
I may (I don’t remember) have built the app without autorotation or something, could it have saved that data and fetch that instead of what I now set in the PlayerSettings ? If so, how could I reset that ? (tried uninstalling the app, clearing data AND cache, but still no rotation).
In the meantime, I’ll try to update the packages to match and see if it stop the rotation