How to disable an object by clicking outside anywhere else?

Hello,

I’m building a space game and I want when I click in empty space for the red indicator I placed around my character to be SetActive (false), in other words for the red indicator to turn off.

When you click on the object(OnMouseDown) that has the red indicator over it, the red indicator object is lit, when I click outside the object, I want the red indicator over my character object to be disabled. How?

Replace you MouseOver (just assuming) usage with a single raycast. Just cast that ray, if the mouse is clicked and check what you hit.

void Update () {
            if (Input.GetMouseButtonDown(0))
            {
                if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), distance))
                {
                    //Check what we clicked on
                }
                else
                {
                    //Didnt clicked on anything
                }
            }
    	}