I’am trying to detect when the user is touching an UI element in an Android Tablet, this is what I’am doing:
if (Input.GetTouch(0).phase == TouchPhase.Began)
{
if (EventSystem.current.currentSelectedGameObject != null)
if(EventSystem.current.currentSelectedGameObject.layer == 5)
Debug.Log("UI element");
}
This works, but only with buttons or scrollbar elements, not with UI Panels…Why is this ?