hey i have a basic health script (e.g picture) witch destroys the player when reached 0 so i was wondering if you could figure out how to when the bullet collides with player take away 30 point of the script… i would be very grateful if you help
here is the health script:
var curHealth : int = 100; var maxHealth : int = 100;
function Start () { }
function Update()
{
// if the player is dead destroy him
if(curHealth <= 0)
Destroy(gameObject);
// if curHelath < 0 -> curHealth = 0; if curHealth > 100 -> curHealth = 100
curHealth = Mathf.Clamp(curHealth,0,100);
}
hope this helps thanks
.harry