hi, is there a way to stop all mouse click (left/right/middle) on any object’s collider and UI on the scene? I don’t want to use cursor lock/disable, I want the cursor still moving as normal but can’t click on anything
I had also try to create an image canvas at bottom of hierarchy with Graphic raycaster that block all object and layer, enable Raycast target, but the object and UI behind it still got clicked
I use this for all events (including mouse):
public static void SetEventSystemAvailability (bool enabled)
{
UnityEngine.EventSystems.EventSystem eventSystem = UnityEngine.Object.FindObjectOfType<UnityEngine.EventSystems.EventSystem>();
if (eventSystem != null) eventSystem.enabled = enabled;
}
Edit: It’s for the UI only
your strategy of making a big image that covers the whole screen should work, make the color all red to make sure it is covering everything, and then change the alpha to 0
make sure that raycast target is enabled for the image
and that the image is part of the canvas group, and that it is detecting clicks on itself