UI Button priority over box collider
I have a box collider that does something on mouse click. In the camera view, the collider is partially covered by a canvas with a UI button. When I click on the UI element, the collider always seem to take priority, not the button. Is there a way to have the button take priority over the collider? I have tried moving the button forward on the z axis, but that doesn't seem to make a difference. Thanks for any help!
Comment
Are you doing a raycast on the box collider? How does the box work?
It's a 3D model with a box collider component and a script with the On$$anonymous$$ouseClick function.
Your answer
![](https://koobas.hobune.stream/wayback/20220612184126im_/https://answers.unity.com/themes/thub/images/avi.jpg)