void OnTriggerEnter2D(Collider2D col) { if (col.tag == "Player_Projectile") { enemy.takeDamage(col.GetComponent <Player_Projectile> ().wpnDmg); if (col.GetComponent <Player_Projectile> ().punchthrough >= 1) { col.GetComponent <Player_Projectile> ().punchthrough--; } else if (col.GetComponent <Player_Projectile> ().punchthrough < 1) { //making new arrow, adding it to this GameObject newProp = Instantiate(col.GetComponent <Player_Projectile> ().arrowProp, col.transform.position, col.transform.rotation) as GameObject; newProp.transform.parent = transform; col.GetComponent <Player_Projectile> ().punchthrough--; Destroy(col.gameObject); } enemy.updateHP(); } }