Is is possible to create a smartphone (iOS and/or Android) app with Unity that supports both landscape and portrait orientations? By support I mean that the app gets notified that the orientation has changed and can adjust layout accordingly.
For example, with the Monkey Island iOS games you play the game in landscape and when you put the game into portrait it displays a menu. Would something like that be possible in Unity?
Answer by Anxo
Jun 01, 2011 at 04:12 PM
Check Devise Orientation in the documentation. You can continuously check how the device is oriented and change your game accordingly.
Wouldn't continually checking device orientation be bad for performance? Is there a way to get notifications that the orientation has changed?
@thomasw: there are no notifications. You can just check Input.deviceOrientation a few times per second; it won't have any effect at all on performance.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users post good questions and use the site effectively we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
4 People are following this question.
Android Splash Screen starting in Portrait mode
How can I limit my app to specific orientations?
Why do I get lower framerate in Portrait than I do in Landscape? Can I fix this?
iOS8 Screen Orientation Bug??
Screen orientation change in scenes (unwanted effect)