- Home /
touched ui element name C#
Hi, I would like to know how to get UI element (image for example) name. I tried raycasting, touch.position but cannot catch any UI elements. I need it to check if my finger is inside an image and know exactly what image. I'm on android remote.
unity-touch-001.jpg
(294.9 kB)
Comment
Answer by Tulsisvt · Feb 25, 2016 at 10:23 PM
i wouldn't expect mouse will work on android but touch not. That's weird for me but it's working somehow. Is it ok?
unity-touch-002.jpg
(48.1 kB)
use this : foreach(Touch t in Input.touches) { //your code }
I cannot get it right: It's giving me right name of UI element I'm touching but only if I'm using one finger. I want the name of UI element touched by every finger.
unity-touch-003.jpg
(21.8 kB)