Collider 2d is not working

I am trying to click on one of the bottoms of a menu, but the collider is null inside the Physics2D.Raycast when I check it out.

That is the code:

Code (CSharp):

I have noticed when I click on the object that will show the menu it is working, but when the menu shows up and I click on one of the options, nothing happens. All options are inside a game object called menu and all them have the box collider 2d.

Does someone can help me out?

I got it! I had created an empty object with the script to create the tower which create the menu when I click on them. It was not working like that. Now, I only switched the script to the main camera and it is working.

Does someone can explain the difference? It seems the Physics2D.Raycast() has to be placed in the main camera.