Search Unity

VR Game Movement

Discussion in 'AR/VR (XR) Discussion' started by imallenyang, Jul 28, 2016.

  1. imallenyang

    imallenyang

    Joined:
    Jan 29, 2016
    Posts:
    2
    I was trying to make a VR game about wing suit flying, and I wanted to use the accelerometer in the phone to track the head movement. I wanted to allow the players to rotate the character when they raise and lower their heads. But because the startup position of the phone is vertical to the ground, Input.acceleration.x will get the same value moving in either direction. Is there any way to implement this?
     
  2. lumeneo

    lumeneo

    Joined:
    Mar 3, 2014
    Posts:
    60
    Define your own neutral point by storing the difference between where it is and where you want it to be in a Vector3 and then offset the input Vector3 with the difference Vector3.