Search Unity

Gear VR touchpad - "HandleDown -> rotate camera (look around) -> HandleUp" detect "Swipe"

Discussion in 'AR/VR (XR) Discussion' started by peteRunner, Feb 12, 2017.

  1. peteRunner

    peteRunner

    Joined:
    Oct 7, 2014
    Posts:
    7
    Hello,

    In one script for Gear VR I am detecting tap (touch the touchpad) and swipe (swipe on Gear VR touchpad):
    Tap - fire weapon (MouseDown)
    Swipe - change weapon.
    When camera don't rotate (player don't look around), everything is OK.

    But when player touch the touchpad - Fire (HandleDown), then rotate head and then release touch (HandleUp), script detects it as a swipe.
    Similar as MouseDown -> movement with mouse (look) -> MouseUp.

    Could you help me, how to prevent from detecting swipe, when ouy do: HandleDown -> rotate camera (look around) -> HandleUp

    EDIT:
    Currently I have solution, that I am checking angle between HandleDown - HandleUp < threshold, But there has to be more intuitive and simple solution.

    Thank you.
     
    Last edited: Feb 12, 2017
  2. iexistband

    iexistband

    Joined:
    Sep 12, 2016
    Posts:
    5
    Is there some other First Person or Cross Platform Controller attached to your character? I could see Unity being confused if VR head movement is doing the same thing as mouse look