playerlives

added basic playerlives counting for the free-for-all gamemode. Sstill needs to be implemented
This commit is contained in:
djkellerman
2025-02-17 14:09:17 -05:00
parent 543590347a
commit fe8c8c3ef4
3 changed files with 59 additions and 0 deletions

View File

@@ -38,6 +38,20 @@ public class Damageable : MonoBehaviour
}
damage += actualForce;
damage = Mathf.Clamp(damage, 0f, maxDamage);
if (damage >= maxDamage)
{
Die();
}
}
private void Die()
{
PlayerLives playerLives = GetComponent<PlayerLives>(); //add death animation trigger
if (playerLives != null)
{
playerLives.PlayerDied();
}
}
public void ResetDamage()