Search Unity

Cardboard: How to get Head / Camera to inherit rotation from parent object?

Discussion in 'AR/VR (XR) Discussion' started by toxicfrog, Nov 23, 2015.

  1. toxicfrog

    toxicfrog

    Joined:
    Jun 13, 2014
    Posts:
    6
    I am porting my Oculus game to Cardboard, and have one final problem to solve:

    The player is in a flying chair. The player moves through the world by gazing on specific objects. When moving, the chair orients to the direction of travel.

    The Cardboard Head node is a child of the chair.

    On the Oculus, the camera's orientation is always relative to the chair.

    But, on the Cardboard, it is not inheriting the rotation from the chair. For example, when the chair turns 90 degrees left, the player in the virtual world remains facing in the same direction as he is in the physical world. I need the player in the virtual world to always be aligned with the chair he's flying on.

    In other words, I need the Cardboard camera's 'Forward' to always be relative to the chair's 'Forward'.

    I've tried using a target object in the Cardboard Head object, but no luck.

    I'd appreciate any advice, and will reply with results.

    Thanks!
     
  2. toxicfrog

    toxicfrog

    Joined:
    Jun 13, 2014
    Posts:
    6
    I thought I'd solved it, but nope... It's still happening. Any advice? I've tried everything I can think of.

    The Cardboard Main and Head are following the Chair's position, but they don't rotate correctly so that 'Forward' is always facing forward in the chair. It seems to rotate part of the way, but does not keep a perfect orientation with the chair, so it gets worse with every turn, until eventually 'Forward' is literally 90 degrees off (or more).

    I appreciate any suggestions!
     
    Last edited: Nov 24, 2015