```
bool clickingGuiElement = false;
if (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject())
{
    if (UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject != null)
    {
        if (UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject
.GetComponent<CanvasRenderer>() != null)
        {
            // user is clicking on a UI element (button)
            clickingGuiElement = true;
        }
        else
            clickingGuiElement = false;
    }
    else
        clickingGuiElement = false;
}
else
    clickingGuiElement = false;

```

The code above is utilizing Unity's EventSystem. This small control structure serves the purpose of handling objects being currently clicked on. It accomplishes the task of setting a boolean to inform the program whether the user is clicking on an UI element or not. In my case it is primarily utilized on buttons. Using this boolean output one can block UI clicks from propagating through the UI and interacting with any gameObjects that may be behind the UI.

Running through the code above on the HoloLens with breakpoints and/or printouts the result is always the same - false. The program never makes it into the first if statement on the HoloLens.

I need to be able to detect if the users airtap/clicker input, when they click, is on a UI element. If I know when a user clicks on an UI element, I can block it from propagating through the UI (as is done above, but, again, it works in the Editor and not on the HoloLens).

So, what substitutes the same EventSystem functionality achieved here (in the Editor) on the HoloLens?

P.S. I am using IPointerClickerHandler from UnityEngine.EventSystems in other parts of my code and it works fine, so I am not sure why this implementation utilizing the EventSystems isn't working. My best guess (from implementing features in the Editor vs the HoloLens) is that the 'Pointer' used in IsPointerOverGameObject isn't utilizing airtap input akin to mouse click input.