Kronnect

Grid Systems (Terrain, 2D, Hexasphere) => Support => Topic started by: charbela on June 06, 2021, 01:30:41 AM

Title: Highlighting and clicking stops working when I add an EventSystem
Post by: charbela on June 06, 2021, 01:30:41 AM
Unity 2021.1.7f1, latest TGS version

After adding an EventSystem to my scene highlighting (and click events) on cells no longer work, or works for a second and then stops when I click anything.
If I disable the event system (even at runtime) everything works again.

Is it a known issue? I can provide repro if needed
Title: Re: Highlighting and clicking stops working when I add an EventSystem
Post by: Kronnect on June 06, 2021, 06:07:37 PM
Do you have the "Respect Other UI" enabled? When using Canvas UI elements, TGS will detect if the pointer if above any UI element (like a button or panel that blocks raycasts) and will ignore any click (this is to prevent clicking through buttons for example).
If you add an EventSystem to Demo03_CellsVisibility you shouldn't have that issue. Can you try it?
Title: Re: Highlighting and clicking stops working when I add an EventSystem
Post by: charbela on June 09, 2021, 10:38:09 AM
Do you have the "Respect Other UI" enabled? When using Canvas UI elements, TGS will detect if the pointer if above any UI element (like a button or panel that blocks raycasts) and will ignore any click (this is to prevent clicking through buttons for example).
If you add an EventSystem to Demo03_CellsVisibility you shouldn't have that issue. Can you try it?

That was it, I just had to disable Respect Other UI and it worked. What puzzles me is, the button I added wasn't over the map. Could be because my canvas is a screen overlay? In all cases it's resolved now, thanks!
Title: Re: Highlighting and clicking stops working when I add an EventSystem
Post by: Kronnect on June 09, 2021, 04:42:49 PM
A simple canvas overlay won't block the interaction. Probably you have some panel or other UI element (perhaps transparent) under the canvas occluding the grid that has the "Raycast Target" property enabled.