Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity detect a touch on ui element

foreach (Touch touch in Input.touches)
{
    int id = touch.fingerId;
    if (EventSystem.current.IsPointerOverGameObject(id))
    {
        // ui touched
    }
 }
 
PREVIOUS NEXT
Tagged: #unity #detect #touch #ui #element
ADD COMMENT
Topic
Name
6+2 =