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 are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    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,103
    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,103
    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,103
    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