using UnityEngine;
public class EnemyHP : MonoBehaviour
{
public int HP;
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.CompareTag("Shell"))
{
HP -= 1;
if (HP < 1)
{
Destroy(gameObject);
}
}
}
}
using UnityEngine;
public class EnemyHP : MonoBehaviour
{
public int HP;
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.CompareTag("Shell"))
{
HP -= 1;
if (HP < 1)
{
Destroy(gameObject);
}
}
}
}