how to make enemy attack unity code example
Example 1: how to make enemy attack unity
private void OnCollisionEnter(Collision collision)
{
if(collision.gameObject.tag == "Enemy")
{
Destroy(gameObject);
}
Example 2: how to make enemy attack unity
private void OnCollisionEnter(Collision collision)
{
if(collision.gameObject.tag == "Enemy")
{
Destroy(gameObject);
}