- Home /
Other
Hey I would like to learn via script how to change automatically the screen orientation
I'm currently developing an app for iOS with a spaceship and more aliens. I would like to create the game in the following manner: whenever the player holds the phone either vertically or horizontally, the screen orientation should change automatically. I've searched a lot for a relevant answer, but it is absolutely ridiculous that I have not found anything pleasing so far. Most tutorials talk about the Canvas Scaler, but it is not precisely what I am looking for.
Could someone please post a script, a solution, maybe even some relevant links for this issue? And I hope this question would enhance the Unity Answers on this matter. Please, post your best answers!
Answer by Mukabr · Oct 04, 2016 at 10:25 PM
Open the PlayerSettings panel (Edit>Project Settings>Player), in Resolution and Presentation you'll find the Orientation option. Choose the Auto Rotation.