NGUI Issue

I’m having an issue where when I click a button on the screen, the mouse click raycast will also select something on the screen if it’s behind the button. I’d like the raycast priority to go like this:
-NGUI elements
-If it didnt click one of those, then check to see if it raycasted something in the scene (that’s not NGUI)

Any help would be appreciated. Thanks.

You could just test two seperate layermasks: first for the NGUI layer, then if nothing is hit then test for layers in the background.

I think the issue with this is that NGUI uses two cameras. One for the GUI and one for the actual game. So when you click you’re actually getting two raycasts at the same time.