how to make an enemy that attacks the player unity' code example
Example: how to make enemy attack unity
private void OnCollisionEnter(Collision collision)
{
if(collision.gameObject.tag == "Enemy")
{
Destroy(gameObject);
}