Get all objects inside a trigger

Hi. I need a way to get all objects inside a collider-trigger.

I tried it with…

void ScanForItems(Collider Item)
{
    foreach (Collider Item in this.GetComponent<Collider>())
    {
        print(Item.gameobject.name);
    }
}

I can’t use OnTriggerEnter or -stay or anything that works like a routine/coroutine.

Maybe I can use bounds for something like that?

Hi,

you can querry all collider in primitves by Physic functions. You can use

You just use your collider params to feed functions.

 void ScanForItems(SphereCollider Item)
 {
      Vector3 center = Item.transform.postion + item.center;
      Vector3 radius = Item.radius;

     Collider[] allOverlappingColliders = Physics.OverlapSphere(center, radius);
 }