Manually setting Screen.orientation breaks AutoRotate

I have 2 scenes. The first rotates between portrait up and down. The second should rotate between the 2 landscape orientations. When I change scenes I call this code:

Screen.orientation = ScreenOrientation.LandscapeLeft; // This line breaks Auto Rotation
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToLandscapeRight = true;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;

If I set the screen orientation to be landscape left the scene does not rotate anymore when I flip the device.

Setting Screen.orientation = ScreenOrientation.LandscapeLeft; forces the screen into landscape mode, but it also prevents the screen from rotating.

Thus, after setting the autorotate bools, you’ll need to include this line:

Screen.orientation = ScreenOrientation.AutoRotation;

In your case, it should now rotate between the landscape orientations only.