Unity iPhone - Changing to Landscape in code

Hi all,

I am making an app where the menu systems are all to be viewed in Portrait mode. On a particular screen it needs to operate in landscape...

I've looked at setting: iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeRight;

This however, doesn't change the unity player to landscape when I hit play and browse to my horizontal screen.

Also, I need to be able to position things in X and Y normally... at the moment, i'm trying to create my gameObjects and sprites in a rotated manner, so that it gives the appearence of needing to be viewed on the side.. as you can imagine this is very fiddly and ovbiously the long way around this problem.

Any help VERY gratefully receieved.

thanks

Mat

`iPhoneSettings.screenOrientation` doesn't change the orientation in the Unity editor; it only has a visible effect on the device.

In your game view tab exactly under the tab is a dropdown list of orientations you can choose from to change the view in the editor. It has no effect on the build however you would have to set `iPhoneSettings.screenOrientation` as Eric5h5 said.

`
if (Application.isMobilePlatform == true) //work with Iphone android, (mobile device)   

{   

Screen.orientation = ScreenOrientation.Landscape; //or Portrait   

}

`