Healthbar

This commit is contained in:
RochesterX
2025-03-03 18:55:03 -05:00
parent 1e6e33079f
commit 0f0c674d5c
8 changed files with 328 additions and 33 deletions

View File

@@ -18,15 +18,7 @@ public class RespawnOnTriggerEnter : MonoBehaviour
{
if (other.CompareTag(respawnTag))
{
transform.position = spawnPoint;
if (TryGetComponent<Rigidbody2D>(out var rb))
{
rb.linearVelocity = Vector2.zero;
}
if (TryGetComponent<Damageable>(out var damageable))
{
damageable.ResetDamage();
}
GetComponent<Damageable>().Respawn();
}
}
}