Detecting if Airtap is tapped/hold regardless of gaze

I currently detect a held Airtap using the iHoldHandler and "OnHoldStarted"/"OnHoldCompleted" on a GameObject. However, this means the release of the Airtap is only detected when releasing it while gazing at that object.

How can I always detect the release of an held Airtap, regardless of the gaze? Similar to that: how do I detect an Airtap click when not looking at any detectable object?



Best Answer


  • mGravitusmGravitus
    edited September 2017

    Detect an airtap when not looking at any object : use modal input.

    Release of airtap held airtap when not focused - same thing (modal)

    Events are consumed:

    Focused Object

    You could also check for when hands are no longer detected and consider that as an airtap release (which sounds like what you want to solve).

    Hope this helps!


  • I use this code in my projects:

    GestureRecognizer gr = null;
    void Start () {
        gr = new GestureRecognizer();
        gr.TappedEvent += Tap;
    private void Tap(InteractionSourceKind source, int tapCount, Ray headRay)
  • For current versions of the MRTK, check out how it is done in OverrideFocusedObjectTest.unity and TestOverrideFocusedObject.cs. See

Sign In or Register to comment.