very simple collider question

hello guys , i have a very very simple question , i want this:

2 characters are in battle with swords , i made some static variables ;

part o' the AI of character A

static var healthA = 100;

part of the AI of character B

static var healthB = 100;

so what i want is , when character A's sword hits character B , the health of the character B will reduce. So i made another script for the sword of Character A.

function OnCollisionEnter(collision : Collision) 
{

   if (collision.gameObject.tag == "BTeam") {
   ScriptName.healthB -= 50;
   }
    }

but it's not happening , also i tried that to understand where the problem is :

function OnCollisionEnter(collision : Collision) 
{

   if (collision.gameObject.tag == "BTeam") {
   print("hit");
   }
    }

but it's not working too , so the problem is in that collision thing , sword model has "genarate colliders " checked, and character B has mesh collider. ( character B is a simple capsule)

please help guys :).

Did you add a rigidbody to either the sword or the character?

yes i added. Maybe it's because rigidbody options or sumthing , do i need to set a spesific thing in rigidbody to make this , like that collision detection thing in rigidbody ?