- Home /
Event Trigger doesn't work!
I've created a UI Panel with a Text as Child and in the Panel I added a Event Trigger: I want that clicking on the panel, it calls a function of another object. I don't know why but it doesn't work.
Here a screen.
Please help.
Change the option "Runtime Only" to "Editor and Runtime" and check if it works.
Answer by Flaring-Afro · May 11, 2016 at 06:43 PM
It sounds like the text child (and any other children) are blocking the click. Make sure they have "Raycast Target" unchecked. Any gameobject lower than the panel in the hierarchy also could block the click. Make sure they either aren't raycast targets or they aren't over the panel. Even if the part of the gameobject that you can view isn't blocking it, if the invisible rect transform dimensions go over the panel, they will block click events.
ok, i've unchecked raycast target, but nothing has changed here the child properties
Solved! There were two problems: one of these has mentioned by Flaring Afro, in fact now i've unchecked all raycast target over this panel; the second one was a trigger problem, in fact it called an Asset object ins$$anonymous$$d a Scene object, so it was like doesn't exist. Now work good... thanks for the help ;)