Problem with this script, am I just really stupid because I can't find the problem.
#pragma strict
var Health : int;
var explosion : GameObject;
var target : Transform;
function DeductPoints (Damage : int) {
Health -= Damage;
}
function Update () {
if (Health <= 0) {
Destroy(gameObject);
Instantiate(explosion, target.position);
}
}
↧