UI button Tap not working


I am trying to have a user be able to tap on to a UI button in unity for HoloLens. I have the following code attached to a camera to recognize a tap and the GestureRecognizer_Tapped() overridden method is not working. Can any one help me?

void Start ()

    GestureRecognizer gesturRecognizer = new GestureRecognizer();
 **   gesturRecognizer.Tapped += GesturRecognizer_Tapped;**


private void GesturRecognizer_Tapped(TappedEventArgs obj)

    Debug.Log("You have tapped a button");
Sign In or Register to comment.