Then next time i hit it take another.
The problem is i am trying to create a delay (Got that) So that i can play ananimation when i die the problem is when i hit the collider and stay there for 5 seconds it removes all my lives
see code below
private var dead = false;
var mydeadsound : AudioClip;
function OnControllerColliderHit(hit : ControllerColliderHit) {
if(hit.gameObject.tag == "fallout") {
HealthControl.LIVES -=1;
AudioSource.PlayClipAtPoint(mydeadsound,transform.position);
yield WaitForSeconds(5);
dead = true;
}
}
function LateUpdate()
{
if(dead)
{
transform.position = Vector3(69.05988,0.8250099,0.01707077);
dead = false;
}
}