Instead of constantly calculating the distance it would be way easier and less performance heavy to just use ZonePlus. Basically, when the player enters the zone near the door, it opens and the next room generates, this is what ive done in my own game I made that was based on Doors.
2 Likes