Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice
  2. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

InputTracking.Recenter() and vertical "centering"

Discussion in 'AR/VR (XR) Discussion' started by Metron, Feb 22, 2017.

  1. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,076
    So, basically what I'm looking after is this:

    In my application the user can take any position he wants. In fact, quite often he might be lieing in his bed.

    My scene is set up so that the camera is facing front when I look forward normally.

    Thing is, when you lie in you bed, you still want to face the camera forward into the world.

    InputTracking.Recenter() should be the right function to achieve this, but unfortunately, it only seems to adjust the horizontal alignement. The vertical alignment is not taken into account.

    Any idea how to get this working?
     
  2. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,076
    anyone?
     
  3. DrBlort

    DrBlort

    Joined:
    Nov 14, 2012
    Posts:
    70
    Use a hierarchy of empty GameObjects and make the camera a child. Then rotate and move the GameObjects as you wish. I've used it and it works well.
    EDIT: You may want to make the whole world a child of that hierarchy too.
     
  4. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,076
    Finally that's what I've done after I posted the question. Implemented an automatic and manual recalibration...
     
  5. yulong_zhang

    yulong_zhang

    Joined:
    Nov 2, 2016
    Posts:
    1
    Could you please share your method?
     
  6. CubicleNinjas

    CubicleNinjas

    Joined:
    Apr 5, 2014
    Posts:
    17
    Hey there, I know this was a while ago but I'm running into the same issue. I want to implement a "lying-down" mode for my Oculus Quest app, but seems the camera only wants to recenter horizontally and not vertically. If you remember could you say how you accomplished this? Thanks!
     
unityunity