gear vr detect long press then release on touchpad

I’m working on a gear vr app and am trying to improve my teleport mechanic. Right now when you look at the ground the teleport marker appears at that position and the user taps on the touchpad to teleport.

I want to change it so that when I hold my finger on the pad for a moment the teleport marker appears then when you release as long as you’re still looking at the ground you teleport. i can’t find any examples of how to do this though I’ve seen it being done in other games so I know it’s possible.

Can anyone point me in the right direction?

You need to increment some counter when OVRInput.GetDown() then check if it’s above a threshold to show your teleport marker. and on OVRInput.GetUp() you reset that counter and activate the teleport mechanic. Following code is untested.

            public float longPressThreshold;
            private float counter;
            private bool isMarkerOn;
    
            void InputsManager()
            {
                if (OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad))
                {
                    counter += Time.deltaTime;
                    if (counter >= longPressThreshold)
                    {
                        isMarkerOn = true;
                        // Show teleport marker
                    }
                }
                if (OVRInput.GetUp(OVRInput.Button.PrimaryTouchpad))
                {
                    counter = 0;
                    if (isMarkerOn)
                    {
                        // TEleport Mechanic
                    }
                }
            }