Target | Showreel

PHOTO EMBED

Tue May 17 2022 16:17:04 GMT+0000 (Coordinated Universal Time)

Saved by @BiscuitTinx #c#

using UnityEngine;

public class Target : MonoBehaviour
{
    public float health = 50f;

    public void TakeDamage(float amount)
    {
        health -= amount;
        if (health <= 0f)
        {
            Die();
        }
    }

    void Die()
    {
        Destroy(gameObject);
    }
}
content_copyCOPY