External Physics2D.OverlapCircle check not working.

I wrote this piece of code inside an abstract class:

public bool IsPlayerInRange (Transform transform, float range)
	return Physics2D.OverlapCircle(transform.position, range, LayerMask.NameToLayer("Player"), Mathf.Infinity, Mathf.Infinity);

And then I wrote this inside another class that inherited from the abstract class:

if (IsPlayerInRange(transform, 4))
	Rbody2D.DashSides(stats.movement_speed * 2, 0.2f, false);

But somehow it doesn’t check for the player. Why? Thanks in advance.

the minDepth argument for Physics2D.OverlapCircle should be negative infinity probably