Z
Z
Zefirot2021-09-07 20:54:12
Unity
Zefirot, 2021-09-07 20:54:12

How to prevent clicking on a sprite that is under the UI button?

I have something like a moving map, you can click on some points on the map and a dialog box appears, the map is a sprite with sprites, there is also a UI button to exit the map, everything works except for one but - if it matches that sprite on which you can click it turns out to be under the exit button, then when you click on it, it’s not the exit that works, but clicking on the sprite ...
Tell me how to avoid this?
(I tried to adjust the panel under the button, it does not help, clicks on sprites go through the panel ...)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BFGunner, 2021-09-08
@Zefirot

Well, just look for an error in the location of the UI panel, as for me. There was one time such a situation, one on one. It turned out that with a certain stretching of the screen (at a different resolution), the text itself "spread" correctly, but the backing panel for the text, which processed the click, did not. It turned out that the text and the sprite of the button were in one place, and the active place for poking in another, more precisely, only partially overlapped the text. Try digging in that direction.
If, when you click in the same place on the button, it either triggers, then no, perhaps the sprite is in some way in front of the button. How is a click on a sprite handled? Is it also a UI element?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question