I am setting my default orientation, in my player settings, to “Auto Rotate”.
This works fine. The problem is that when you disable the “Auto-Rotate” in the system settings of an android device, the unity player doesn’t care, and auto rotates the screen anyways.
This has been tested on 3 different devices, so it is not a single device problem. I have been trying to find a work around for this problem, and have failed to do so up to now.
Can anyone shed some light on this issue? Surely I cannot be the only one that has found this bug? Is there any way to disable the auto-rotate when the device has is explicitly disabled?
This is a major bug in Unity. For those who are stumbling here trying to find a solution, a very awesome gentlemen posted a fix over here at github
Hopefully Unity fixes this crazy bug soon, so we don’t have to use workarounds like this in the future. From what I read, it is by design, which in my opinion is horrible design.
It’s not really a bug. If an application requires landscape and can’t run in portrait at all it will rotate to landscape, even when the rotation is locked. There’s no way around this since you forced the rotation to the one you specified.
If you turn off auto rotate in the system settings of the device, all you tell the OS is to not rotate automatically when you tilt the device. Applications still can rotate the screen. However when the rotation is locked on the device it only allows necessary rotations (landscape → portrait or portrait → landscape).
Try any other android app that requires a certain orientation: For example minion rush or subway surfers which only works in portrait. They always rotate to portrait. What you can influence with auto rotate is if it is allowed to rotate it upside-down. I use my nexus7 upside down most the time. Minion rush of course forces portrait but it also rotates to the “normal” (non upside down) rotation. When you “lock” your rotation upside down it will stay since it’s also a portrait rotation. Though the game works, things involving accelerometer input are reversed when playing upside down.
So if you force a certain orientation it will rotate to that rotation at least if it’s a different orientation type.