You mean for mobile devices right?
Read this: Unity Scripting - Screen.orientation
Screen.orientation = ScreenOrientation.LandscapeLeft;
Screen.orientation = ScreenOrientation.Portrait;
You mean for mobile devices right?
Read this: Unity Scripting - Screen.orientation
Screen.orientation = ScreenOrientation.LandscapeLeft;
Screen.orientation = ScreenOrientation.Portrait;
where should i include this script in my scene?
– ashwin12995i have many game objects but i dunno in which game object i shld include the script so that it will affect the screen orientation
– ashwin12995Doesn't matter where you put the script. I would put it on the Camera in the scene, cause this affects the screen.
– Jessespikeso you say to create an empty script with the code you mentioned above and put the script in the camera right? so what should be my player settings for screen and resolution?
– ashwin12995just wondering, what happens if I set default orientation in the player settings. Will this work even then? Say, I have 10 scenes and I want only the first one to be oriented as portrait all others as landscape and I set the default orientation LanscapeLeft and on that particular scene in start function, I wrote Screen.orientation =ScreenOrientation.Portrait;
– zubairhussain404