Why ain't this working?

I’m trying to run the collision against the tags to make how much damage they take change depending on the tag. like if hit by enemy ship 25 health, bullet 1 health and ect.

here the code I pulled it off a help site but it not working.

void OnTriggerEnter2D(Collider other){ // here it checks for triggers

 if (other.gameObject.tag == "enemy")  // here I want it to check if the other object that it touching is enemy, enemy bullet, boss lazar ect;

	{health -= 25;} // here it loses health


I’m using C#, Unity 5. Can anyone give me any ideas of how to get this to work. yes i gave the enemy his tag.

It says error onTriggerEnter2D, but nothing else;

My guess would be that you are missing your rigidbody. To get the OnTriggerEnter2D function to trigger, at least one of your game objects needs to have a Rigidbody2D component in order for the function to be called. Although, it could still be something else causing the issue.