OnMouseDown vs. Button.onClick

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.

I’m not sure if the project is 2D but could you adjust the transforms z parameter I’m wondering if the plans are to close/overlapping.

it would be nice to see an image of it running.

Yes, it is a 2D project, and I have tried adjusting the z depth.

Yeah I think z depth for 2d does not make a difference.

is their any reason you need the game object clickable, as I said a screenshot might help here a little.

I wanted to use it for unit selection. I’m on a train right now and unable to provide a screenshot :frowning: