Android: How to know that any UIElement is touched

I have 3D-scene and UI-buttons over it. When user toch button,any other actions should not be doing

I try

void BoardLogic::HandleTouchBegin(StringHash eventType, VariantMap& eventData)
{
    using namespace TouchBegin;
    IntVector2 screenPos = IntVector2(eventData[P_X].GetInt(), eventData[P_Y].GetInt());
    int touchID = eventData[P_TOUCHID].GetInt();

    // UI-element touched
    if (INPUT->GetTouch(touchID)->touchedElement_)
        return;

    // Interaction with scene objects
}

but it does not work. Any tips?

GetSubsystem<UI>()->GetElementAt(screenPos, true)?

1 Like

Ah thanks, I absolutely forgot this method, although I used it before