Q:

Contact point between OverlapCircle and certain collider in Unity

I am trying to get the contact point between a Collider and OverlapCircleAll to play an animation on that point.
This is the method I am using for the attack.
private IEnumerator BasicAttackBehaviour()
    {
        canAttack = false;
        Collider2D[] enemiesToDamage = Physics2D.OverlapCircleAll(attackPos, attackRange, whatIsEnemy);
        for (int i = 0; i < enemiesToDamage.Length; i++)
        {
            enemiesToDamage[i].GetComponentInParent<Enemy>().TakeDamage(damage);
        }
        PlayAttackAnimation();
        yield return new WaitForSeconds(attackDelay);
        canAttack = true;
    }

And this is the "TakenDamage" method:
public void TakeDamage(int damage)
    {
        health -= damage;
        GameObject bloodEffect = Instantiate(takenDamageVFX, transform.position, transform.rotation);
    }

I want to instantiate the VFX "bloodEffect" on the position the enemy is hitten instead of "transform.position".

A:

You may want to switch to CircleCastAll, it will give you contact points in world space coordinates:
https://docs.unity3d.com/ScriptReference/Physics2D.CircleCastAll.html
You can set the distance parameter to 0.0f if you don't want to do a moving circle and just a single non-moving circle.

