Search Unity

accelerometer and Vr

Discussion in 'AR/VR (XR) Discussion' started by yesyesok, Nov 6, 2016.

  1. yesyesok

    yesyesok

    Joined:
    Apr 17, 2016
    Posts:
    13
    Hey, is it a good idea to use accelerometer inputs for vr games???

    or it's not gonna work that good with Vr gadgets ?
     
  2. Martians135

    Martians135

    Joined:
    Mar 14, 2017
    Posts:
    8
  3. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    If you design your game mechanic around accelerometer input constraints then sure.

    For example a dodging game with 3 lanes:

    when you stand up straight your avatar occupies a central lane.
    If you dodge left then read the accel and dodge avatar to left lane.
    If you dodge right then read the accel and dodge avatar to right lane.

    But remember you cant rely on steady state position, that is: if you dodge left and stay there the chance of player remaining left reduces to zero over time due to accumulated velocity errors, which you are in effect integrating to derive position. The player may have very slowly returned to central lane or perhaps even beyond to other lane and your game logic wont know.

    With this in mind the game mechanic should require central lane to be the main position, left and right positions should be forced temporary by game, for example make sure if player stays on a side lane they're gonna get hit. Side dodges should be temporary and occupy no more than a few seconds.

    As with any noisy analog input scheme it will require tweaking/setting thresholds etc to optimize the interface experience.
     
  4. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Even in cardboard (daydream and gear vr have a gyro) this isn't enough for a comfortable experience with the HMD driven from an accelerometer. As @SiliconDroid mentioned more limited mechanics are fine.

    If using an accelerometer for the HMD, your 3rd axis (yaw) will not be accurate without a gyro and a compass (magnometer). VR requires you to have an accurate representation of what you did otherwise you will get motion sickness. In your video you might also want to apply more smooting as it's jittering a lot which would also cause sickness.