Small question about 2d screens, buttons, and entities/components

I have a small question. In my ETA project, I’ve made a UI screen that holds some buttons. The effected section is in root -> 2D Screen -> Token_Spawn_Group. Attached to it are two scripts: buttonClickThroughExample and tokenSpawnerUI.

The problem is that whenever a user clicks on the token spawner button in the lower-left corner, and then clicks on a button in the menu that pops up, the input just goes straight through and hits one of the tiles. The same thing happens whether lines 16-20 in buttonClickThroughExample are commented out or not. There is debugging script on line 26 of the tokenSpawnerUI script that indicates that the selected entity is, in fact, the entire Token_Spawn_Group. So how do I stop the click from going through?

For additional information, everything within Token_Spawn_Group is an entity, not a component. Could it be that, since they are different entities, buttonClickThroughExample doesn’t recognize them as part of Token_Spawn_Group for the purposes of click-through?

Are you stopping the event propagation on the callbacks on the UI?

I don’t know what that means. But as far as I can tell, buttonClickThroughExample works just fine for the sidebar buttons, and since I implemented it the exact same way for Token_Spawn_Group, it should do the exact same thing.

The closest thing I have to a call back are the mouse events, and they’re labeled the same in tokenSpawnerUi.js (the one that doesn’t work) as they are in Ruler.js (the one that works).

…Turns out I had buttonClickThroughExample turned off. Oops.

1 Like

I figured it out on my own. Thanks for letting me use you as a rubber duck!