Answers for "unity detect a touch on ui element"

1

unity detect a touch on ui element

foreach (Touch touch in Input.touches)
{
    int id = touch.fingerId;
    if (EventSystem.current.IsPointerOverGameObject(id))
    {
        // ui touched
    }
 }
Posted by: Guest on April-11-2021

Browse Popular Code Answers by Language