Close Panel when touch the screen (touch position not in panel)

I has a “setting panel” , I want close it when i touch the screen (touch position not in this panel) .
I tried but this can’t display when touch the help button .

I think when I touch the help button I accident close this panel

How to fix this problem?
thanks guys !

If you want to close the settings panel when you touch anywhere in the screen, add an event trigger on the panel and use setactive = true/false.

I think it’ll be easier to include a close button at the corner of the panel, and add event trigger to that button, so when the button is pressed, it’ll close the panel.

Is this what you’re referring to?

1 Like

I tried Use close button but I want touch anywhere in the screen close Panel . Thank for your reply

I see, in that case, add another panel on top of that Close Panel, add event trigger, use setactive. :slight_smile:
No problem.

1 Like

How to add event trigger to panel? Can you help me?

Select the object you want to have touch event, in your case, the panel, the add component > search event trigger > at the bottom part of even trigger > click on the + icon to add a function.

I’m not good at explaining that part, try googling it. :slight_smile:

1 Like