Search Unity

[HELP] How to obtain data for User Head Tracking and UI with Google Cardboard in Unity 5.6

Discussion in 'AR/VR (XR) Discussion' started by SciCom69, Jul 27, 2017.

  1. SciCom69

    SciCom69

    Joined:
    Apr 25, 2017
    Posts:
    1
    I would like to obtain UI and Head Tracking data (vectors) in a Google Cardboard (Gvr) app made in Unity 5.6 in order to obtain a saved data file that will provide parameters for Fitts' (Usability) testing. Problem is that the new Unity release (5.6) now includes some new (unfamiliar to me) components that replace older components that were easier to code to obtain such User data. How can I obtain such data for User Head Tracking and UI with Google Cardboard (Gvr) in Unity 5.6?

    Observed Behavior
    Compile error when trying to add method scripts to existing (i.e. new) components in Unity 5.6: for example, code method scripts that may have been applied to GvrViewerMain no longer work with the new GvrEditorEmulator (Unity 5.6).

    upload_2017-7-27_13-22-37.png


    Desired Behavior
    To add scripts that will extract Head Motion as vectors for distance measures to a target, and scripts that will give reticle-to-target distance and reticle-hover UI data in a file that can be obtained from the Android Google Hardware.

    Steps to reproduce
    Switch to Android Platform in Build Settings
    Import Gvr SDK
    Set Player to VR Supported and Cardboard in Virtual Reality SDK's
    Create Scene with Curved Menu and Canvas
    Add _HeadTracking script to GvrViewerMain
    Add Scene to Build Settings
    Build and Run on Android Google Cardboard phone

    Relevant Information
    Unity Version 5.6
    Code for the HeadTracking:
    https://gist.github.com/OrganumTechnology/c57a92ab2671e8e8e951abbed77fec44

    Steps Tried Already
    I have tried to
    1. adapt pre-existing code by inserting vector scripts for head motion into new Unity 5.6 components like GvrReticlePointer and GvrEditorEmulator (as above)
    2. Have attached C# scripts to these corresponding game objects in the appropriate scenes.

    but have not had any success in producing error free code.
     
    Last edited: Jul 27, 2017