0

I want to set custom OnClick trigger area for my button which icon is a child of Button object:

enter image description here

However, the button triggers OnClick only when clicking on it's child Image (ButtonIcon on the image above) ignoring the actual width and height of the button itself.

How to set a custom trigger area?

1 Answer 1

1

Add a Panel UI element as a child of your Button:

enter image description here

Then set "Source Image" sprite to None and Color alpha to 0:

enter image description here

Now you can set a custom size of touch area!

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.