'verticalOrientation' is not a member of 'iPhoneSettings'

I’ve created an empty game object and, following the suggestion of several people in a few threads on here, attached the following script:

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

But the parser’s telling me that neither ‘screenCanDarken’ nor ‘verticalOrientation’ are members of iPhoneSettings. The docs tell me otherwise-- any ideas?

I copied the code in a js, for me, no errors …

Sure you started Unity iPhone and not Unity 2.1 and have using UnityEngine; in your script? (or whatever the JS counterpart is) :wink:

There isn’t one…with JS you don’t specify that.

–Eric

That’s my immediate guess too. Can you (the OP) confirm that you’re in the right Unity app (Unity iPhone)?

Going to About->Unity gives me v1.0.0f1 and the unity iPhone logo. I do have both iPhone Unity and Unity 2 installed on here though, could there be some conflict there?

I should also mention that I have

iPhoneInput.multiTouchEnabled = true;

elsewhere in another script, but I don’t get any complaints from the compiler on that one.

No, the apps don’t intermingle (heck, I have Unity 1.6.2, Unity 2.1, Unity iPhone 1.0.1 plus other internal builds and I don’t get any errors.

Can you create a new project and test there? The cited code looks just fine so I’m wondering if you have errors elsewhere that are confusing the compiler (?).

<scratchin’ my head>

I was having exactly the same issue, confirmed by Jessy as well with my file.

The problem for me is the .js file I had attached to the GameManager was named iPhoneSettings.js"

A no-no apparently.

Yeah, you likely have your own iPhoneSettings.js file somewhere, which will take precedence over the Unity class (Unity should really warn when this happens, every now and then someone does it with some class or another)…