How do I catch a click on a non-interactable button?
I have a (Ui-) Button that has the ".interactalbe" attribute.
Now I want some explanation-popup for the user, explaining why that button is not working when they click on it.
Is there a (halfway elegant) way to catch a click on a button when .interactable is set to "false"?
Answer by Perceive · Sep 16, 2015 at 02:50 AM
Yes! Add an EventTrigger onto the button, add a "Pointer Click" event, and link this up to a function. The EventTrigger will still get called when the button is set to non-interactable. If the function is on another GameObject, make sure you have a reference to the button. You can then check the Button's interactable state, returning if it's still interactable.
I had to look some things up, but your suggestion worked perfectly. Thanks a lot!