- Home /
How do I force a mobile game to use portrait perspective?
I want to make a game only view able in portrait mode. I found screen.orientation but do I make a new script and attach it to the main camera? How do I prevent it from auto rotating and shrinking the games picture?
Answer by allenallenallen · Jul 27, 2015 at 05:22 AM
Yes, you make a new script that runs immediately after the app is launched.
void Awake(){
// Forces the screen to be in portrait mode. That's it. Since it's not set to ScreenOrientation.AutoRotation, the device will NOT auto rotate no mater what.
Screen.orientation = ScreenOrientation.Portrait;
}
Answer by Suraj. · Jul 27, 2015 at 05:24 AM
hi..Just go to build settings...then playersettings..then under Resolution and Presentation,Set your desired default Orientation ..Oh sorry.i think u need it through script to force.
Your answer
Follow this Question
Related Questions
I have a serious problem! 1 Answer
Camera projection ploblem in Android device 1 Answer
2D game with angled top-down camera perspective 1 Answer
2d isometric - 3d render order 0 Answers
auto-rotation in-script 0 Answers