pgiz3/Assets/Scripts/Target.cs
2026-03-21 01:16:00 +03:00

22 lines
353 B
C#

using UnityEngine;
public class Target : MonoBehaviour
{
public float health = 50f;
public void TakeDamage(float amount)
{
health -= amount;
if (health <= 0f)
{
Die();
}
}
void Die()
{
// For now, we'll just destroy the target object
Destroy(gameObject);
}
}