Possible to return the names of gameobjects inside a rect?

As I said in the title, is it possible to create a rect and check which objects is inside it and return their names?

I tried using rect.Contains but couldn’t get it to return the names, the only thing I was able to do was check IF an object is inside but not getting the name.

The reason I want to do this is because I want to make a selection box thing and then add the gameobjects inside the box to a list of selected units.
Any help is appreciated :slight_smile:

Could be that I get the question wrong but what about a Trigger/Collider on the rect and checking the Method OnTriggerStay(collider col) for the objects within the collider?