- Home /
Question by
Emilian0 · Nov 29, 2015 at 09:53 AM ·
uiinputtoucheventsystem
EventSystem not detecting all UI elements
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 ?
Comment
Your answer
Follow this Question
Related Questions
Input registering random touches 1 Answer
Can I change the input "submit" and "cancel" button of an eventsystem from a script? 0 Answers
How do I detect when UI events are triggered on *any object*? 1 Answer
How to solve event triggers blocking scrollview inputs in an inventory/menu? 2 Answers
Prevent multiple UI elements receiving input from different pointers? 2 Answers