Search Unity

orientation is landscape but iPad/iPhone mask still rotates?

Discussion in 'iOS and tvOS' started by tallyho_stu, Jun 28, 2010.

  1. tallyho_stu

    tallyho_stu

    Joined:
    May 10, 2010
    Posts:
    38
    Hi, I've just noticed this for iPad(OS:3.2) and iPhone(OS:4.0). Building my app for iPhone and running on it on iPhone (OS:3.1.3) with orientation set to landscape there's no problem - the app images doesn't rotate. However, on the updated units (using same build for iPhone and separate one for iPad) although the screen orientation is still fixed i.e. doesn't rotate, you can see a black 'mask' rotating over the top of the app (hope that makes sense) when changing the unit's rotation. I'm not aware of any way to control this specifically - anyone have any ideas how to handle this?

    The Unity build for iPhone was set to OS:3.0 and OS:3.2 for the iPad.

    Thanks
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    the mask rotation comes from the keyboard.
    it has distinct commands to disallow rotation.

    your old device potentially would have it too but might just be too slow and thus "jumps over the animation"
     
  3. tallyho_stu

    tallyho_stu

    Joined:
    May 10, 2010
    Posts:
    38
    thanks dreamora, not seen this problem before.

    i've tried:
    Code (csharp):
    1. iPhoneKeyboard.autorotateToLandscapeLeft = true;
    without luck. Also tried to assign the 'active' bool value but was getting a null reference(SIGBUS) in xcode I think because the keyboard wasn't actually active at the point of assignment - as far as I know I'd have to open it for that to be the case which leaves me wondering why I'm seeing it in the first place?

    Cheers
     
  4. MikaMobile

    MikaMobile

    Joined:
    Jan 29, 2009
    Posts:
    845
    What you want to do is set all of those iPhoneKeyboard.autorotate bools to false. The problem is they're all true, by default, which is where that mask is coming from. Setting the "proper" direction to true does nothing.
     
  5. tallyho_stu

    tallyho_stu

    Joined:
    May 10, 2010
    Posts:
    38
    Thanks guys, that fixed the problem :)
     
  6. okimoki

    okimoki

    Joined:
    May 13, 2010
    Posts:
    116
    ok, i have the same problem, but cant find where to change those values? I have only basic knowledge of xcode :)
     
  7. ParaLogic

    ParaLogic

    Joined:
    Aug 19, 2010
    Posts:
    177
    You'll have to add that to your script in Unity :) Not Xcode.
     
  8. spentak

    spentak

    Joined:
    Feb 11, 2010
    Posts:
    246
    I put those exact values in the Start() method of persistent gameobject/script and i still get the black edge rotation. Any thoughts?
     
  9. JamesMobot

    JamesMobot

    Joined:
    Jul 8, 2010
    Posts:
    170

    function Awake ()

    :)
     
  10. bernardfrancois

    bernardfrancois

    Joined:
    Oct 29, 2009
    Posts:
    373
    Works perfectly here setting all bools to false in the Awake method. Like this it works for any game, landscape or portrait.