iPad orientation doesn't change?

I’ve added code to my iPad app in function Update() to check what the input orientation is and change the iPhoneSettings so that the screen is in the correct position by using the following code:

    if ((iPhoneInput.orientation == iPhoneOrientation.LandscapeLeft)  (iPhoneSettings.screenOrientation != iPhoneScreenOrientation.LandscapeLeft)){
      iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeLeft;
    }
    if ((iPhoneInput.orientation == iPhoneOrientation.LandscapeRight)  (iPhoneSettings.screenOrientation != iPhoneScreenOrientation.LandscapeRight)){
      iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeRight;
    }

But when I move the iPad around, the iPhoneInput.orientation always stays in LandscapeLeft, I can never get the orientation to change to LandscapeRight no matter how much I move around the iPad. The accelerometer works. Is there something I need to do in Unity to turn on the iPhoneInput.orientation function?

Hello aerende,
iPhoneInput.orientation should change with your device orientation unless iPad orientation is locked with “orientation lock” switch on the side of iPad.

@mantasp:

That was the problem! Thank you so much for your answer!!!