Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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:
    652
  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:
    652
  5. cmbrown

    cmbrown

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