My app in unity is all Vertical but I have one Scene where I need it to be horizontal only. How can I do this? I want it so that when you click the button to load the scene it turns the phone horizontal, then when they go back to the original scene it will go back vertical.
Asked
Active
Viewed 470 times
1 Answers
1
Disable auto rotation in the Awake
function:
Screen.autorotateToLandscapeRight = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.autorotateToPortrait = false;
Screen.autorotateToLandscapeLeft = false;
You can then change the orientation as
Landscape:
Screen.orientation = ScreenOrientation.LandscapeLeft;
Portrait:
Screen.orientation = ScreenOrientation.Portrait;
As for detecting clicks on a button, see this post.

Programmer
- 121,791
- 22
- 236
- 328
-
It does not work for me.I could not change the mode with respect to scenes. – deniz baş Sep 08 '22 at 20:57