Files
pgiz3/Assets/Scripts/Target.cs
T

21 lines
353 B
C#
Raw Normal View History

2026-03-21 01:16:00 +03:00
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);
}
}