This commit is contained in:
BOT Alex 2024-04-21 11:58:34 +02:00
commit 40a4bd45ca
2 changed files with 2 additions and 2 deletions

View File

@ -5038,7 +5038,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
bounciness: 1 bounciness: 1
damage: 10 damage: -10
wallRebounces: 4 wallRebounces: 4
comingFrom: {fileID: 0} comingFrom: {fileID: 0}
OnReflect: OnReflect:

View File

@ -29,7 +29,7 @@ public class HealthComponent : MonoBehaviour
OnHealthChangeAtPos?.Invoke(transform.position, currentHealth - damage); OnHealthChangeAtPos?.Invoke(transform.position, currentHealth - damage);
currentHealth -= damage; currentHealth -= damage;
currentHealth = (int)Mathf.Clamp(currentHealth, 0f, Mathf.Infinity); currentHealth = (int)Mathf.Clamp(currentHealth, 0f, startHealth);
if (currentHealth == 0) if (currentHealth == 0)
OnHealthZero?.Invoke(); OnHealthZero?.Invoke();
} }