2d collision with damage not working.

Can somebody help me with this script as it does not inflict damage to the player as programmed, the two objects of player and enemy both collide and push against one another but the health remains the same. Both objects have rigidbody 2d and 2d colliders set as triggers. I can publish further details if needed.

public class Enemy01 : MonoBehaviour {
    public float timeBetweenAttacks = 0.5f;
    public int attackDamage = 10;

    GameObject player;
    PlayerHealth playerHealth;
    EnemyHealth enemyHealth;
    float timer;

    void Awake()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        playerHealth = player.GetComponent<PlayerHealth>();
        enemyHealth = GetComponent<EnemyHealth>();
    }


    // Use this for initialization
    void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
        timer += Time.deltaTime;
        
          
        }
    void OnTriggerEnter(Collider other)
    {
            if (timer >= timeBetweenAttacks && playerHealth.currentHealth > 0)
            {
                Attack();
            }
            
    }

    void Attack()
    {
        timer = 0f;
        if (playerHealth.currentHealth > 0)
        {
            if (gameObject.CompareTag("Player"))
            {
                playerHealth.TakeDamage(attackDamage);
            }
            
        }
    }
}

Oh wow I’m so blind, if you’re working with 2d rigidbodies and 2d colliders OnTriggerEnter won’t work. You must use OnTriggerEnter2D(Collider2D other) as shown here Unity - Scripting API: MonoBehaviour.OnTriggerEnter2D(Collider2D)