Commit 60859dbc authored by HelloLitty's avatar HelloLitty

death case added

parent 7bbc00b0
......@@ -53,14 +53,22 @@ public class Life : MonoBehaviour
{
if (damagePossible)
{
damagePossible = false;
animator.SetBool("isDamaged", true);
life--;
health.LifeLost(life);
//die Kraft der beiden Objekte für die richtung des Knockbacks
knockback = other.transform.position - playerRigidbody.transform.position;
playerRigidbody.AddForce(knockback.normalized * -250f);
StartCoroutine(Invincebil());
if(life > 1)
{
damagePossible = false;
animator.SetBool("isDamaged", true);
life--;
health.LifeLost(life);
//die Kraft der beiden Objekte für die richtung des Knockbacks
knockback = other.transform.position - playerRigidbody.transform.position;
playerRigidbody.AddForce(knockback.normalized * -250f);
StartCoroutine(Invincebil());
}
else
{
animator.SetBool("isDeath", true);
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment