Raycast collision detection on a 2d game

Hi everybody i have a problem, i am doing a 2d game where with mouse we must tap objects, i tried to use raycasts but does not Work here’s the code:

void Start() 
{
Ray ray=Camera.main.ScreenPointToRay(Input.moisePosition);
} 
void ClickFunction() 
{
If(Physics.Raycast(transform.position,-Vector3 up,out Ray,100))
{
Destroy(GameObject.FindObjectWithTag("zombie");
} 
}

When raycast collides should destroy the gameobject but does not Work.
What is wrong ?
Thanks in advance!

Try updating ray every time you click. Otherwise the only value used for your ray will be where the mouse was at when your level began.

I.E.:

void Start() 
{
    // This should be empty
} 
void ClickFunction() 
{
    Ray ray=Camera.main.ScreenPointToRay(Input.mousePosition);

    If(Physics.Raycast(transform.position,-Vector3 up,out Ray,100))
    {
        Destroy(GameObject.FindObjectWithTag("zombie");
    } 
}