How to make my game work in landscape mode only? (without screen rotation)
5 Answers
5- Go to
Edit > Project Settings > Playerit will openPlayer Settingsin the inspector. - Select the target platform from the list.
- Click the
Resolution and Presentationsection. - Set the
Default Orientationto 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
Only 1 Option can be chosen at a Time Either Landscape Left or Landscape Right, There is no such option to set Landscape Left/Right
β SaumyaSauravin 2020.3.24f1, the Orientation setting does not exist. Instead I think it has been replaced by "Supported Aspect Ratios" where you can set what aspect ratios are accepted.
β theforgot3n1void Start ()
{
Screen.orientation = ScreenOrientation.LandscapeLeft;//or right for right landscape
}
To make your app Auto Rotate in only some directions , you can
- Go to
Edit >> Project Settings >> Player. - Select the target platform (Android/IOS).
- Click on
Resolution and Presentation. - Under
Orientationset the Default Orientation toAuto Rotation. - Under that you will see a list appear
Allowed Orientations for Auto Rotation. - Select the one you want your app to
Auto Rotatein.
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?

Here is a Youtube tutorial for Screen orientation if you are interested: https://www.youtube.com/watch?v=Dfp9_0Ct2cw&t=1s
β catop