Skip to main content

Handling Orientation

If you are using an app with a portrait main menu and landscape gameplay, this article will help you understand how to make your application orientation work correctly with the OS UI.

This page is only needed if you have a game with landscape gameplay and plan to use a portrait main menu or have other views/scenes that render in portrait. If your game is designed for portrait-only or landscape-only, these instructions do not apply.

If you use a mix of landscape and portrait views (such as having a portrait main-menu and landscape in-game views) you can control the screen orientation by setting Screen.orientation. (Ex: a landscape view that uses Screen.orientation = ScreenOrientation.Landscape;).

You must allow for the portrait orientation from the Unity editor, then when transitioning to your gameplay, you will want to restrict the user from rotating into portrait while playing to prevent your UI from distorting.