Landscape mode only
How to make my game work in landscape mode only? (without screen rotation)
Here is a Youtube tutorial for Screen orientation if you are interested:
Answer by AyAMrau · Aug 19, 2014 at 05:02 PM
Go to Edit > Project Settings > Player it will open Player 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
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
It IS possible to Unlock the ,,Landscape Left AND Right" Orientations, while Blocking the Portrait Orientations.
If you set the Orientation to ,,Auto Rotation", the Option ,,Allowed Orientations for Auto Rotation" appears.
There, you can Check multiple Screen Orientations you want to allow.
in 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.
Answer by rajbhatelia · Oct 28, 2018 at 06:51 AM
@Sosasees To make your app Auto Rotate in only some directions , you can go to Edit >> Project Settings >> Player. Now select the target platform (Android/IOS). Click on Resolution and Presentation. Now under Orientation set the Default Orientation to Auto Rotation. Now under that you will see a list appear Allowed Orientations for Auto Rotation. Select the one you want your app to Auto Rotate in.
Answer by daniyaljavaid95 · Sep 14, 2016 at 12:33 PM
void Start(){ Screen.orientation = ScreenOrientation.LandscapeLeft;//or right for right landscape }