You might be using the term “Array” incorrectly and that is potentially causing some confusion.
To clarify, do you simply want to know if there is an object in an area (for example a box) and you want to know it when the user clicks the left mouse button?
If that is your question, the answer is BoxTraceForObject(s). Matthew Wadstein has an easy to follow video that is still relevant (WTF Is? Box Trace for Objects).
If that is not your question than it might help to break it down a little into smaller parts to understand what you are trying to do. Maybe start at the end and work backwards.