Please refer to this page for how to add code properly (nicely) on the forums
This script is on the house?
One option would be to link the door in the prefab, and then in Start() you could add the door to the list (but make the list static so there is just 1 copy).
Alternatively, you could keep the list in some other script, but using the same idea, just add the transform to that list.
Small optional notes:
- You can use a coroutine to slow down the number of distance checks.
- you can use sqrMagnitude for a slightly more efficient search comparison.
- you could update the distance list only when the player moves (possibly in combination with either of the 2 ideas above).