iPhone in Widescreen - Little glitch in the docs

On the page about iPhoneSettings.verticalOrientation things are actually the other way around: the default is true (vertical) and you have to set it to false to go horizontal…

I was a bit confused at first because with the iPhone Remote it changes orientation depending on the aspect ratio of the play window and ignores this variable alltogether…

Where is the page about this in the docs …

iPhoneSettings.verticalOrientation

Never mind … found it …

file:///Applications/Unity%20iPhone/Unity%20iPhone.app/Contents/Documentation/Documentation/ScriptReference/iPhoneSettings-verticalOrientation.html

Where do you set this value? I assume you need to create a start up script right?

Just add a start script to your camera:

function Start() {
	iPhoneSettings.verticalOrientation = false;
	iPhoneSettings.screenCanDarken = false;
}

I also added the ‘screenCanDarken’ line to make sure that the iPhone does not auto turn off if the screen hasn’t been touched.

Yup, a generic start up script attached to an empty game object. If you need to have this exist throughout additional scenes you’ll want to make sure that the “DontDestroyOnLoad (this);” is set in that same function Awake ().

In my case I use a script called iPhoneSettings.js that looks partly like this …

// set up default settings for iPhone
static var screenCanDarken;
static var verticalOrientation;

function Awake () {
	// set screen orientation and sleep mode
	screenCanDarken = false;
	verticalOrientation = true;
}