I am using uGUI (4.6 beta) for windows and toolbars. Is it possible to prevent the mouse from clicking through to 3d elements behind it?
I’ve tried adding 2D and 3D coliders to the UI elements
I am using uGUI (4.6 beta) for windows and toolbars. Is it possible to prevent the mouse from clicking through to 3d elements behind it?
I’ve tried adding 2D and 3D coliders to the UI elements
// UI elements will receive this hit/hover
if (EventSystem.current.IsPointerOverGameObject()) { // UI elements getting the hit/hover
}
Found the answer here
if (EventSystemManager.currentSystem.IsPointerOverEventSystemObject())
Debug.Log("left-click over a GUI element!");
else Debug.Log("just a left-click!");