How detect click in box collider 2D

I’m trying to detect and handle click event (OnMouseDown) in a box collider 2D but i can’t.

I created first an empty gameobject with a component 2D box collider. I have a script attached to this object and inside i tried :

void OnMouseDown(){
 //Print
}

But there is no effect… How can i do that ?

Hello. I have example you can try:

public Gameobject objneedshow;

void OnMouseDown()
{
    objneedshow.SetActive(true);
}

when you click on object, this object will show.

I would try 2D Raycasting: unity - Detect mouse click on object with no script attached - Game Development Stack Exchange