How Physics2D.OverlapCircleAll works???

here is my IsGrounded method,

bool IsGround(){

	if (rigidBody.velocity.y <= 0) {

		foreach(Transform points in groundPoints){

			Collider2D[] colliders = Physics2D.OverlapCircleAll (points.position,0.2f);

			for(int i=0;i<colliders.Length;i++){

				if (colliders *.gameObject != gameObject) {*
  •   				return true;*
    
  •   			}*
    
  •   		}*
    
  •   	}*
    
  •   }*
    
  •   return false;*
    
  • }*
    what does this part do??
    if (colliders .gameObject != gameObject) {
    * return true;*
    * }*

Hi @EhsanEhrari

Physics2D.OverlapCircleAll works like Physics.OverlapSphere. It return ALL of the colliders2d in the given radius (in your case 0.2f).

Your IsGround method return true if there at least one gameobject other than the one the script is on.