Unexpected Symbol if in class struct?

here is my script i don’t know how to fix this error i want to add tag to collusion so when i touch only the enemy player to die not every time ?
using UnityEngine;
using System.Collections;

public class PlayerMovement : MonoBehaviour {

public float jumpHeight;
public float moveSpeed;
public GameManager manager;
private bool isDead;
// Use this for initialization
void Start () {
	
}

// Update is called once per frame
void Update () {
	if(CFInput.GetKeyDown(KeyCode.Space)){
		GetComponent<Rigidbody2D>().velocity = new Vector2(GetComponent<Rigidbody2D>().velocity.x,-jumpHeight);
		
	}
	transform.Translate(new Vector3(1,0,0)*moveSpeed*Time.deltaTime);
}
void OnCollisionEnter2D(Collision2D other)
	if(other.tag == "enemy")
{
	// If we have, call the bird's die method
	Die ();
	Time.timeScale = 0;
}

void OnTriggerEnter2D(Collider2D other)
{
	// In that case, add one to our player's score
	manager.curScore += 1;
	
}

// Method that controls the bird's death
void Die()
{
	// Set a boolean of isDead to true so that we can do some checks later
	isDead = true;
	manager.showGameOver = true;
}

}

You were missing a set of curly brackets :slight_smile:

void OnCollisionEnter2D(Collision2D other)
if(other.tag == “enemy”)
{
// If we have, call the bird’s die method
Die ();
Time.timeScale = 0;
}

void OnCollisionEnter2D(Collision2D other)
{
if(other.tag == “enemy”)
{
// If we have, call the bird’s die method
Die ();
Time.timeScale = 0;
}
}

Your OnCollisionEnter2D should have {} as every other function…

 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.tag == "enemy")
     {
         // If we have, call the bird's die method
         Die();
         Time.timeScale = 0;
     }
 }