Only use specific collider

Hello!

So what i want to do is make an enemy do stuff only when a 2D collider attached to a bullet gameobject touches the enemy. Now the enemy will react to every collider that touches him. How would i go about to fix this?

void OnTriggerEnter2D (Collider2D other) {
		Debug.Log ("Zombie Hit");
	}

Thank you!

/Taegos

I’m new to unity as well so I’m not so sure but I believe you can use the Tag function.
Attach a tag called bullet to the bullet and then do something like this.

 void OnTriggerEnter2D (Collider2D other) {
if(other.CompareTag("Bullet"))
         Debug.Log ("Zombie Hit");
     }

Set tag on enemy to " Enemy "

void OnTriggerEnter2D (Collider2D other) {
    		if (other.gameObject.CompareTag("Enemy")) {
    			Debug.Log ("Zombie Hit");
    		}
    	}