I need help with my simple health system. It has many errors in that need to be cleaned up.
This is my first health script and I need to know how I can get it to work like I want it to.
var health = 100.0;
private var dead = false;
var DamageA = -10.0;
function OnControllerColliderhit(hit : ControllerColliderHit)
{
if(hit.gameObject.tag=="fireball")
{
health + DamageA;
}
}
function LateUpdate()
{
if (0 > health)
{
dead = true;
}
if(dead) = true
{
transform.position = Vector3(0,0,0);
dead = false;
}
}
↧