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){
    Debug.Log("Player died.You lost!");

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:


    //to this


    //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