Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Upside down VR app?

Discussion in 'Android' started by agilelensalex, Dec 28, 2014.

  1. agilelensalex

    agilelensalex

    Joined:
    Apr 7, 2014
    Posts:
    24
    Whether I turn on auto-rotate or set the player settings to 'landscape right', I can't get my game to treat the world as following this orientation (landscape right always shows everything upside down and landscape left always shows everything right side up).

    The reason I need it to be landscape right and not landscape left is because this is a Google Cardboard app, and the magnet trigger is on the left side of the device.

    Anyway, does anyone know how to actually change this?

    I've tried adding a line to void Start or function Start that says: Screen.orientation = ScreenOrientation.LandscapeRight; and it doesn't seem to make a difference.

    It's possible that there's a Durovis Dive or Oculus Rift script I'm using that is locking this (since this is a VR game), but any help at all would be much appreciated. Thanks!
     
  2. dolims

    dolims

    Joined:
    Sep 13, 2014
    Posts:
    61
    There are a couple of places this can get specified at build time:
    • Under the Edit->Project Settings->Player menu, in Resolution and Presentation.
    • In the AndroidManifest.xml file, which if you are using the Cardboard SDK, is in the Asset/Plugins/Android directory, in the <activity> tag.
     
  3. agilelensalex

    agilelensalex

    Joined:
    Apr 7, 2014
    Posts:
    24
    thanks dolims.

    hmm... well I'm using the Durovis Dive SDK, but interestingly enough, not only can I not find the file you're mentioning-- there doesn't seem to be any .xml files in my project folder at all!
     
  4. dolims

    dolims

    Joined:
    Sep 13, 2014
    Posts:
    61
    Usually the Androidy files like the manifest get filled in by Unity for you during the build, so you wouldn't normally have one in your project. The Cardboard SDK has one because it overrides some defaults.
     
  5. skeegan

    skeegan

    Joined:
    Mar 3, 2015
    Posts:
    1
    I'm having the same problem-did you find a solution?
     
  6. agilelensalex

    agilelensalex

    Joined:
    Apr 7, 2014
    Posts:
    24
    Hi skeegan,

    Unfortunately no. For the VR Stuff I'm doing, I've just taken to using Dodocase VR since in that one it just touches that screen, so it's okay if the phone is flipped in a nonconsistent direction.
     
  7. vfxjex

    vfxjex

    Joined:
    Jun 3, 2013
    Posts:
    93
    try landscape left in player settings.
    with landscape right the gyro is inverted.