Search Unity

Android App does not start in VR mode, but at the very startup the screen orientation is wrong

Discussion in 'AR/VR (XR) Discussion' started by danielesuppo, Aug 7, 2017.

  1. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Hello All,
    I'm working on a Cardboard VR Android App, that start with no VR Sdk loaded, and next switch to Cardboard VR with "VRSetting.LoadDeviceByName".

    I started to work on it with Unity 5.5.3 and, despite no VR Sdk was loaded at startup, during runtime the screen was always in landscape mode, from the Splash Screen, menus, etc, despite player settings.
    So I moved to Unity 5.6.2 and now the Splash Screen and everything else is correctly in Portrait mode (obviously until I load the Cardboard SDK).

    So, everything OK??? No!
    Because on my Samsung Galaxy S6 with Nougat as soon as I launch the App the screen rotate to landscape mode (with all the icons) and immediately it turn back to portrait mode, just before to show the Unity logo.
    I can't see this issue on My Galaxy A3, but I think it's still there, it's just because it's less performing than S6.

    Ok, it's not a very big bug, but it's really ugly to see all the Android icons that turn and get stretched in landscape mode and next the screen that turn back in portrait mode each time I launch the App..

    Does anybody else is experiencing the same issue? Is there someone that know a solution?

    Many thanks!!!
    Daniele
     
  2. DHein

    DHein

    Joined:
    Jan 26, 2016
    Posts:
    38
    Have you tried disabling vr support, then setting the default orientation to portrait and then turning on vr support again?
     
  3. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Hi Acctubi,
    thank-you for your kind reply.
    Yes, I did it (leaving the default "auto rotation" setting would make the App in landascape), but at launch the screen rotate to landscape before to rotate back to portrait.
    Unfortunately I don't have many mobiles to test, I'd really like to know if it's an issue related to my specific mobile (Galaxy S6), or Nougat, or if it's a common issue...
     
  4. DHein

    DHein

    Joined:
    Jan 26, 2016
    Posts:
    38
    The only thing I have experienced using Unity 5.6.1f1 and cardboard/daydream on the S5, S6, S7 and the Google Pixel XL is that at launch the phone indeed goes into landscape mode for a short time. Although it seems to be a common "bug", I don't see any icon stretching, only the rotation. If this is the problem you are experiencing, it seems that it is indeed a common bug.
     
    Last edited: Aug 9, 2017
  5. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    As soon as you use
    Code (CSharp):
    1. VRSettings.LoadDeviceByName("cardboard");
    it will set the screen to landscape left. thats because the cardboard VR requires it to be used in landscape mode.
    if you set it to None as VR SDK it should be able to launch in portrait (out of mind)

    but as soon as you load the device by name it'll go landscape mode... poor design but yeah I guess it is required for the SDK to initialize properly.
     
  6. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    If you use Google VR (cardboard) version 0.6, you can fully control the orientation of device, and toggle VR mode on and off.
     
  7. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Thank-you for all your replies,

    Acctubi:
    yes, it's exactly my problem

    MaskedMouse:
    I'm starting my app with no SDK loaded, and next I load the device by name, and it work, but the only issue is that at the very start of the app the screen rotate to landscape for a short time before to rotate back to portrait (just as Acctuvi wrote).

    Selzier:
    Thank-you for your suggestion, does 0.6 version work with Unity 5.6.2 (and or Unity 2017.1)?
    P.S. Just note please that actually the screen is correctly in portrait mode before loading the Cardboard SDK, but as Acctubi wrote "the phone goes into landscape mode for a short time" at the startup.
     
    Last edited: Aug 10, 2017
  8. HaMrDev

    HaMrDev

    Joined:
    Nov 4, 2019
    Posts:
    7
    i have a problem with it as soon as i run it i can see one eye view and i cant rotate