Very confused... Physics.OverlapSphere working, but not NonAlloc version?

Suddenly, all my NonAlloc versions of Physics.Overlap just stopped returning any colliders. Thought I was going crazy, until I put the identical regular versions above them. The regular versions are functioning just fine… the _hitColliders array it’s outputting to also becomes null.

Any ideas? A physics bug?

For some odd reason my Collider array was becoming null, even though it was initialized as Collider[] _hitColliders = new Collider[25]; in its declaration.

By adding _hitColliders = new Collider[25]; again in the code, it started functioning properly again. Still confused, but at least it’s working!

One thing to check is that the size or your array is large enough. If enough elements are found and the array is small enough, certain objects you’re looking for might not be in the array.
With 25 elements you should be safe, but it is still a possibility.