using UnityEngine;
public class strikebox : MonoBehaviour
{
void OnCollisionEnter(Collision collision)
{
if (Input.GetKeyDown(KeyCode.Mouse0) && (collision.gameObject.name == “hitbox”))
{
Destroy(gameObject, .1f);
}
else if (Input.GetKeyDown(KeyCode.Mouse0))
{
}
else if ((collision.gameObject.name == “hitbox”))
{
}
}
}
I am trying to make it so when an enemy comes into a players hitbox and u left click it dies, but it does nothing? I searched for it yet found nothing. Also it does not show any errors.