Unfortunately the way these GameObjects are appearing is that if a sensor (a real life hardware sensor) sees a person it creates a person GameObject. If it does NOT see a person, it deletes the person GameObject. So it is non-deterministic as it is running in another thread.
I didn’t know you were destroying them. I don’t know the answers to your two questions off the top of my head. I’d have to test them (which I’m too lazy to do, sorry ).
I’d consider two approaches.
Use SphereCast or BoxCast to find all objects within the collider’s area. If the collider you’re using is already a regular shape, such as a cube or sphere, then this should be pretty easy. You can then find how many objects are within this space whenever needed.
When you instantiate one of these objects, you add it to a list. When you destroy one of these objects, you remove it from the same list. Then whenever you need to you can just iterate through the object list and check for whatever criteria you need to, such as distance to something, etc.
I highly doubt that. At least last time I checked Unity API wasn’t thread-safe and thus was only available from the main thread. So if you destroy game objects, you have to be on the main thread. Or I’m misunderstanding something in your setup.