1. I was wondering if something like this can be done.

    Code:
    BasePlayer player = ...
    foreach (Door door in doorlist) //no idea where to loop
    {
         // if door is near player then...
    }
    UPDATE

    Code:
    var doors = UnityEngine.Object.FindObjectsOfType<Door>();
    foreach (Door door in doors)
    {
    }
    
    Now I have to find if the door is near the player.
     
    Last edited by a moderator: Nov 13, 2016
  2. You should be able to use vis.entities which allows you to specify a radius, and then just filter everything in the list that isn't a door.
     
  3. Use BaseEntity.savelist to iterate
    [DOUBLEPOST=1479020694][/DOUBLEPOST]FindObject very slow
     
  4. As Shady757 said, I would use vis.entities around a player. And convert all to a list with door. You can look in my SmartHomes plugin for a example.