There are two arrays, one

Collider[] coldal = Physics.OverlapSphere(transform.position, radiusdal); 

Second

  Rigidbody[] rbs; void Start() { rbs = FindObjectsOfType(typeof(Rigidbody)) as Rigidbody[]; } 

It is necessary to find intersections in them, i.e. all Rigidbody currently in OverlapSphere.

Tried without an array of Rigidbody, but it turns out the use of GetComponent in Update, which is not the best impact on resources.

    1 answer 1

    Each collider has a link to the rigidbody to which it is attached Collider.attachedRigidbody . So all that is needed is to simply map the two arrays.