Make UI elements block OnMouseDown event on 3d objects.
Hi everybody! I'm trying to make a small puzzle game for Android.
I have a grid of small quads (not UI). Each of them has a script attached to it, with OnMouseDown function inside. Every time I touch this quad - it sends it's coordinates to the gamecontroller script. Then the UI buttons appear on the screen, to handle what should be done with the quad. And everything seems well. But there is a problem. UI elements dont block OnMouseDown event on quads. If the button is above the quad - active quad changes to the one under the button + the button gets pressed. So the wrong quad is being handled.
What should I do? Raycast Target box is checked on every UI element. Is there any way to buypass this problem? Maybe I can replace OnMouseDown with some other function that will be blocked by the UI?
Thanks in advance!
Your answer
Follow this Question
Related Questions
how can i create an interactive text in GUI.Window? 0 Answers
Update canvas in all scenes when edited? 0 Answers
Dont round decimal places? 2 Answers
Unity Web Player GUI mismatched with events & strange shadows 0 Answers
Unity performance questions 1 Answer