Collision Problem

function OnControllerColliderHit (hit : ControllerColliderHit) {

if (ApplyDamage){
    if(hit.collider.gameObject.tag == "Enemy"){
        var v = hit.collider.gameObject.GetComponent("EnemyAI");
        v.healthPoints -=10;
        v.enemyState = 6 ;
    }
}ApplyDamage = false;
if (hit.moveDirection.y > 0.01) 
    return;

}

I have this function on my character to inflict damage to the enemy, it works fine if the enemy has a Capsule collider component but it fails if I use a Character Controller component..... Any help please?

Try OnCollisionEnter(col : Collision) and test if the tag of the collision is the same as the enemies and if so ApplyDamage