- Home /
how i can make my player lose 1 live after HP = 0 ?
hi i want to know how i can make the player lose a live like this :
public float DefaultSpeed;
public float HSpeed = 1f;
public float Vspeed = 0.5f;
private bool PlayerDestroyed = false;
if(HP <= 0 && Lives > 0)
{
transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z + Time.deltaTime * 3);
Vspeed = 0.1f;
HSpeed = 0.1f;
PlayerDestroyed = true;
}
if (PlayerDestroyed )
{
DestroyDelay += Time.deltaTime;
if (DestroyDelay > 6)
{
Scene CS = SceneManager.GetActiveScene();
SceneManager.LoadScene(CS.name);
}
**Lives -= 1;**
}
it cant work like this withe me can anyone fix it for me plz
Comment
Can you explain mroe what you are trying to do and why that doesn't work? Is it that you when you reload the scene you don't lose a life?
Your answer
Follow this Question
Related Questions
Respawn Player after Health 0 1 Answer
Ragdoll toggle unity 2d 1 Answer
Player Character Health 2 Answers
Enemy Boss doesn't take damage. 2 Answers
Cant Sync UI over UNET 0 Answers