Thanks for the code part, I actually used unitys Physics2D.OverlapSphere, it was more efficient and had better results in testing.