How to make my game work in landscape mode only? (without screen rotation)
1 Like
- Go to
Edit > Project Settings > Player
it will openPlayer Settings
in the inspector. - Select the target platform from the list.
- Click the
Resolution and Presentation
section. - 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
- Go to
Edit >> Project Settings >> Player.
- Select the target platform (Android/IOS).
- Click on
Resolution and Presentation.
- Under
Orientation
set 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 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?