I am currently working on a Project, right now working on the Doors and I do question myself whats the best memory efficient way to detect if a player is near a door.
Back then, I always looped through all doors and checked how far the player is away but thats prob. very inefficient.
If you’re using the ProximityPrompt that Roblox provides they should appear automatically when you get close enough, at a distance you can configure. If you’re making your own prompts then you may have to manually check the distance to the player. Another possibility could be to use an invisible hitbox around the door and listen for a Touched event.
You can add an extended part and then do: game.workspace:GetPartsInPart(doorExtenderPart)
Then loop through the parts it returned, check if it’s an ancestor of the player, if so, show proximity prompt. But proximity prompts do have a field, where you can specify the value at which the proximity prompt will be shown.