Die on collision doesnt work

i have a code for health and in the code i have a code so i would die on collision with the enemy, the enemy has a riged body and my charector does too and we both have a charector.collider() or whatever it is but the code is not working please help!
the code is:

var PlayerHealth: float = 10.0;
var EnemyDamage: float = 10.0;//(damage per sec)You may change it to kill player quickly
 
function OnTriggerStay(enemy: Collider){
  if(enemy.CompareTag("Enemy"))
{
 PlayerHealth-=EnemyDamage*Time.deltaTime;
}
  if(PlayerHealth<0)
  {
    Debug.Log("Player died.You lost!");
    Destroy(gameObject);
  }
}

Might as well try loading a new scene instead of destroying, you could load a level.

  1. Make a level, call it Respawn

  2. Change this:

    Destroy(gameObject);

    //to this

    Application.LoadLevel(“Respawn”);

    //and then add Respawn to build settings.

i think you are just missing a collider you need a physic collider and have it check if trigger in that collider if using a trigger function