I’m having some trouble resolving an issue.
The scenario:
I have a canvas. This canvas is set up so that there are some buttons on it and these buttons have a OnClick() event:
http://puu.sh/oGtuo/eea7726db5.png
All of my UI is on the UI layer.
I also have some models in the scene - these models exist on the Default layer. These models exist in a different world space and have Box Colliders and a script with an OnMouseDown function:
http://puu.sh/oGtDH/800704cbbd.png
Both are positioned in the camera and are visible.
The problem:
Sometimes the two can overlap when something moves around. This looks fine but operates in an unfortunate manner. The UI is always on top which is good; but if I click the UI element (attempting to use the OnClick() event) that event is ignored (I put a debug log in and didn’t get anything) and the OnMouseDown is called (again another debug log confirms this).
So how do I solve this issue? The UI elements are using button actions and the non-UI elements are using OnMouseDown. Thanks for any insight.