I'm coding a system to check if a player is in a certain area next to the enemy. I decided to use Physics2D.OverlapBox, but when I test it, no matter what, it always returns true.
Here's the code:
public bool isNear = false; private Vector2 nearRadius; public float nearRadiusLength; public LayerMask playerLayer; void FixedUpdate() { isNear = Physics2D.OverlapBox(transform.position, nearRadius,playerLayer); }