Hi,
I'm having an issue with Screen.orientation.
The thing is that I am making a game which its default configuration is auto-rotation with landscape right and left selected. There's a time inside the game when it has to be in portrait mode so I set
Screen.orientation = ScreenOrientation.Portrait;
On Android this works as expected, the game turns into portrait mode (without even turning the device, it forces the change which is exactly the behavior I want).
But on iOS nothing happens at all it just stays landscape.
I've tried numerous things, one of them looked promising : [Fix for a screen rotation bug on ios10][1]
but it didn't help in my case.
Another thing I've tried is this:
Screen.orientation = ScreenOrientation.Portrait;
Screen.autorotateToLandscapeLeft = false;
Screen.autorotateToLandscapeRight = false;
Screen.autorotateToPortrait = true;
Screen.autorotateToPortraitUpsideDown = true;
Screen.orientation = ScreenOrientation.AutoRotation;
to see if forcing the device to only have the option of landscape would make any difference and it does. It allows your game to go portrait if you turn the device but if you don't it'll stay landscape, it's not forcing the change as it should.
Has any of you ever encountered this behavior before? I don't know exactly what to do next.
[1]: https://gist.github.com/Ethan-VisualVocal/286ebae00eb3100885b19c90e8b9ff52
↧