Search Unity

Landscape rotation upside down on newest Kindle Fire devices.

Discussion in 'Android' started by Enzign, Oct 11, 2013.

  1. Enzign

    Enzign

    Joined:
    Aug 20, 2010
    Posts:
    169
    Hi good people!
    There seems to be a problem between Unity and the newest Kindle Fire devices. I've been testing on Kindle Fire HDX 7" , but it is the same on the 8.9" as well i've had confirmed. When running a clean project in landscape mode, the game is always upside down. It rotates when i rotate the device, but always upside down. It works when locking the rotation to landscape right or left, but not when enabling autorotation for both of them. It doesn't matter if i put android:screenOrientation="sensorLandscape" in my manifest file, it is the same. That is the recommendation from Amazon and they say that should work. On the two newest devices it doesn't however.

    I would really appreciate if somebody with some insight in this could share some light on the issue. Maybe someone from Unity knows what's going on? If a fix can be expected, or if we need to do some workaround in native code or something?
    Cheers!
     
  2. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
  3. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    This is a know issue. It's not Unity per se - it's amazon that decided that landscape orientations should be reversed on the new kindle devices which makes them slightly incompatible with how android normally works :p

    https://developer.amazon.com/sdk/fire/device-orientation.html

    We will add the product id's of the new devices to the workaround we already have in place for the 2nd gen kindles.
     
  4. Rob-Fireproof

    Rob-Fireproof

    Joined:
    Dec 18, 2012
    Posts:
    56
    Any idea when the workaround is likely to be released?

    I think the first Kindle Fire HDX is due for release in a couple of days, so I'm guessing it won't be in time for that.

    Is there a workaround we can do ourselves in the meantime? I can try to cobble one together myself, but not having an HDX device I've got no way to test it.

    Thanks,
    Rob.
     
  5. Enzign

    Enzign

    Joined:
    Aug 20, 2010
    Posts:
    169
    You can write a workaround in native code. Not sure if it's possible in Unity. What we have done is to just lock the rotation to LandscapeLeft only. Right in Unity, very fast and easy fix. Amazon said that was ok.
     
  6. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    No ETA on this. Did you try HazeTI's workaround?
     
  7. Rob-Fireproof

    Rob-Fireproof

    Joined:
    Dec 18, 2012
    Posts:
    56
    I had a look, but it'd commit us to updating the build every time Amazon release a new model (until Unity/Amazon get together and make a permanent fix). Also, I'd have no way to test it, which makes me a little nervous.

    That's a good idea. I'll go with that for now and update the build again once there's a proper fix.

    Thanks all!
     
  8. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    this is annoying, because that will make it harder for them to upgrade to android 4.3, which has opengl es3 support... dont they know this! All that power and they cant even use opengl es3! wheres a petition to get their stuff upgraded.
     
  9. koochy_rat

    koochy_rat

    Joined:
    Oct 26, 2011
    Posts:
    40
    I've got some code provided by Amazon (they're awesome, fixing bugs for us!). I haven't tested it, not having a device to do so, but it should suffice temporarily until Unity releases a fix.

    Code (csharp):
    1.  
    2. Set Screen.Orientation = ScreenOrientation.AutoRotation;
    3.  
    4. //Create the following void valued function within your script.
    5.  
    6.         void SetupScreen(){
    7.                if (SystemInfo.deviceModel == "Amazon KFAPWA" || SystemInfo.deviceModel == "Amazon KFAPWI" || SystemInfo.deviceModel == "Amazon KFTHWA" || SystemInfo.deviceModel == "Amazon KFTHWI" || SystemInfo.deviceModel == "Amazon KFSOWI")
    8.     {
    9.         if(Input.deviceOrientation == DeviceOrientation.LandscapeLeft )
    10.         {
    11.             Screen.orientation = ScreenOrientation.LandscapeRight;
    12.         }
    13.         else if(Input.deviceOrientation == DeviceOrientation.LandscapeRight )
    14.         {
    15.             Screen.orientation = ScreenOrientation.LandscapeLeft;
    16.         }
    17.     }
    18.     else
    19.     {
    20.         if(Input.deviceOrientation == DeviceOrientation.LandscapeLeft )
    21.         {
    22.             Screen.orientation = ScreenOrientation.LandscapeLeft;
    23.         }
    24.         else if(Input.deviceOrientation == DeviceOrientation.LandscapeRight )
    25.         {
    26.             Screen.orientation = ScreenOrientation.LandscapeRight;
    27.         }
    28.     }
    29. }
    30.  
    31. Then call the SetupScreen() function within the MonoBehaviour's Update() method.
    32.  
     
  10. av_boy

    av_boy

    Joined:
    Jun 25, 2013
    Posts:
    1

    Is this fixed in Unity 4.3? I don't have one of the latest Kindles to test on.

    -sean
     
  11. akasurreal

    akasurreal

    Joined:
    Jul 17, 2009
    Posts:
    442
    This "Fix" (from koochy_rat) does sorta work, but still shows wrong direction then quickly fixes it self and some times I have to turn device around and back again before it does, so very non-ideal user experience. Would also like to know if this is fixed in 4.3, because I have been waiting to upgrade.
     
  12. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Unity 4.3 release notes - "Android: Fixed default orientation for 3rd gen kindle devices"

    That said, no one has yet confirmed the fix actually works. If you have a 3rd gen kindle device please give it a try and tell me how it goes.
     
  13. akasurreal

    akasurreal

    Joined:
    Jul 17, 2009
    Posts:
    442
    I just tested this on 4.3, works great on Kindle Fire HDX 7
     
  14. cviedmai

    cviedmai

    Joined:
    Sep 12, 2013
    Posts:
    1
    We have a game developed with Unity 4.3 and we tested it on a Kindle fire HD 7, it is working fine. However Amazon tested it and they told us the screen rotation was taking way too long (~8 secs). They recommended us to upgrade to Unity 4.3 but we're already using it so we'll just lock the screen orientation..