Hello guys and thanks for reading through my question.
I’m having a problem with Physics2D.OverlapCircleNonAlloc and although it’s not a big trouble I’d still like to know what exactly I’m doing wrong. The following code is executed in the Update() Method.
Collider2D[] GroundOverlap = null;
if(Physics2D.OverlapCircleNonAlloc(GroundedCheck.transform.position, 100F, GroundOverlap, Ground) > 0)
{
IsGrounded = true;
Debug.Log(GroundOverlap.Length);
}
This if statement is never executed, no matter what I try. The LayerMask ‘Ground’ is set to Everything (for Debug purposes) and the GroundedCheck item is at the feet of the player. Now the Radius is set to 100 (also for Debug purposes) but this does not seem to yield anything. Also tried moving the
Collider2D[] GroundOverlap = null;
To the start statement, still nothing. Any help is appreciated!