Last Updated on 2021-10-30 by Clay
If you are making a game for mobile device in Unity, we usually don't set the screen to display horizontal and portrait two version for playing. After all, it is too difficult for art design and scene design..., At least it is absolutely impossible when I develop independently.
How to fix the screen orientation
Edit > Project Settings > Player > Resolution and Presentation
Here you can use Allowed Orientations for Auto Rotation to specify four directions, or directly adjust the default Default Orientation setting.
For example, if I want my screen to have only types of Landscape that can be rotated, and does not support Portrait, then I can set it like this:
References
- https://answers.unity.com/questions/1273713/how-to-set-up-unity-for-portrait-mobile-developmen.html
- https://levelup.gitconnected.com/unity-supporting-portrait-and-landscape-screen-orientations-3330fdb0eaec
- https://docs.unity3d.com/ScriptReference/Screen-orientation.html