unity make sure pressing button doesnt affect underlaying plane code example
Example: unity make sure pressing button doesnt affect underlaying plane
Check EventSystem.current.IsPointerOverGameObject(). If it's true, it means that the mouse pointer is over a GUI element. So check !EventSystem.current.IsPointerOverGameObject()