OnCollisionEnter instead of RayCast??

So i have have a script which makes my fists cause damage, but because i use raycast i can just spam the left button and kill the player instantly…
I want it to cause damage when the Fists actually Collide with the enemy and not by distance.
What would i have to change in this script?

#pragma strict

var TheDamage : int = 50;
private var Distance : float;
var MaxDistance : float = 1.5;
var TheAnimator : Animator;
var DamageDelay : float = 0.6;

private var HitLeftStreak = 0;
private var HitRightStreak = 0;

function Update ()
{
    if (Input.GetButtonDown("Fire1"))
    {
        AttackDamage();
    }
}

function AttackDamage()
{
    if (Random.value >= 0.5 && HitRightStreak <= 2)
    {
        TheAnimator.SetBool("HitRight", true);
        HitRightStreak += 1;
        HitLeftStreak = 0;
    }
    else
    {
        if (HitLeftStreak  <= 2)
        {
            TheAnimator.SetBool("HitLeft", true);
            HitRightStreak = 0;
            HitLeftStreak += 1;
        }
        else
        {
            TheAnimator.SetBool("HitRight", true);
            HitRightStreak += 1;
            HitLeftStreak = 0;
        }
    }

    yield WaitForSeconds(DamageDelay);
    Debug.Log("hit");
    //Actual attacking
    var hit : RaycastHit;
    var ray = Camera.main.ScreenPointToRay(Vector3(Screen.width/2, Screen.height/2, 0));
    if (Physics.Raycast (ray, hit))
    {
        Distance = hit.distance;
        if (Distance < MaxDistance)
        {
        hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReceiver);
        }
    }
   
    TheAnimator.SetBool("HitLeft", false);
    TheAnimator.SetBool("HitRight", false);
}

bump

From what i’ve understood, you need a fire rate on your fists to avoid spam click?
I’m not into javascript, but i’ll try.

var nextFist : float = 0.0;
var fireRate: float = 1.0;     // 1 fist per second

function Update ()
{
    if ((Input.GetButtonDown("Fire1"))&& (Time.time > nextFist))
    {
        AttackDamage();
        nextFist = Time.time + fireRate;
    }
}