Search Unity

Gyro rotate gameobject with camera attached in VR?

Discussion in 'AR/VR (XR) Discussion' started by cmbrown, Dec 7, 2016.

  1. cmbrown

    cmbrown

    Joined:
    May 12, 2016
    Posts:
    7
    Hello! I'm pretty new to Unity on Android. I'm trying to simulate a person's eyes moving around their head using the gyroscope in a Nexus 5. I have a sphere with a camera attached to it that will rotate when I rotate the phone (I'm using Input.gyro). Everything works really well until I add in the gvrViewMain object which rotates the camera and ignores the sphere. Any thoughts of how to get the sphere to rotate while in VR mode too? Thanks very much!
     
  2. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    612
  3. cmbrown

    cmbrown

    Joined:
    May 12, 2016
    Posts:
    7
    Thanks very much! This solved my problem. Very much appreciated!

    Do you happen to know how to change the axes being used by Input.gyro? Each axis is referencing the wrong rotation i.e. turning my head left and right makes the image move up and down. Thanks again!
     
  4. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    612
  5. cmbrown

    cmbrown

    Joined:
    May 12, 2016
    Posts:
    7
    OK. Interesting. I'll take a look at that. Thanks very much!
     
unityunity