Hi. I've come across an interesting little problem and was wondering about the best way to proceed. Apologies if this is covered in another thread but I could not find one.
I have 4 robot characters in a room. Each of them has a box collider on my 3d ui layer. The object with the collider has a script to detect hover and click events so I can make something happen when I click on the robot. So far so good. I can get things happening when I hover and click the robots. However when I leave the room and have scenery between the camera and the robots, the hover and click events still get registered. I understand that this is because the scenery isn't drawn by the ui camera so the clicks and hovers ignore the scenery.
My question is; what is the best way to get my ui to ignore hovers and clicks if there is stuff in the way of the ui objects?
I've had some ideas but was wondering what my more experienced colleagues would do.
Thanks in advance.