Hi, I have problem whit my health script…My player(FPS)dosn’t lose health…
My script is:
var health : float = 100;
function ApplyDamage( amount : float ){
health -= amount;
if ( health <= 0 ) Dead();
}
function Dead() {
print ( name + " is dead now.");
}
function OnCollisionEnter (theCollision : Collision) {
if (theCollision.gameObject.tag=="Enemy"){
ApplyDamage(10);
}
}