Landscape mode only

How to make my game work in landscape mode only? (without screen rotation)

1 Like
  1. Go to Edit > Project Settings > Player it will open Player Settings in the inspector.
  2. Select the target platform from the list.
  3. Click the Resolution and Presentation section.
  4. Set the Default Orientation to Landscape left / right.

To allow both landscape options:

In Default Orientation select Auto Rotation.
Allowed Orientations for Auto Rotation will appear; select the options you want

void Start ()
{
    Screen.orientation = ScreenOrientation.LandscapeLeft;//or right for right landscape
}

To make your app Auto Rotate in only some directions , you can

  1. Go to Edit >> Project Settings >> Player.
  2. Select the target platform (Android/IOS).
  3. Click on Resolution and Presentation.
  4. Under Orientation set the Default Orientation to Auto Rotation.
  5. Under that you will see a list appear Allowed Orientations for Auto Rotation.
  6. Select the one you want your app to Auto Rotate in.

8 years later from the original post, Windows OS are also running on tablets and responds to screen rotation, but there is not a accessible UI in Unity 2021.3 from the Player setting dedicated to setting up orientation behaviour. Is it coding the only way to go?