detect touch Only special Ui

Updated on July 25, 2018 in [A] GUI
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on July 24, 2018

Hi. i have a ui image in my scene. i want to check if only touch on this ui image then my script do something.

i don want to use old Gui system also Ui button.

see this image :

how can i do something like this ?

if (touch in this image area)
{
doSomething();
}
  • Liked by
Reply
1 on July 25, 2018

Create a button and place it there and add an event to reference the function you want to call upon click/touch.

If you don’t want to use button (I don’t know why not) you can add an event trigger component to the image and call a function upon click.

on July 25, 2018

im working on an android fps game. i want when players pushing fire button , they can rotate camera as mouse look in same time.

for now when player push fire , then he can’t rotate camera.

 

Show more replies
  • Liked by
Reply
Cancel