Quantcast
Channel: iOS and tvOS
Viewing all articles
Browse latest Browse all 10823

Detect touch events only when NOT touching UI elements

$
0
0
Hi
Am using the following code to detect touch events only when NOT over any UI element. However, it is not working, touch events still propagate.
Can any iOS experts help?
Code (csharp):
  1.  
  2. var touch = Input.GetTouch(0);
  3.                 if (touch.phase == TouchPhase.Began && !EventSystem.current.IsPointerOverGameObject())

Viewing all articles
Browse latest Browse all 10823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>