How do I get different spawn areas in one terrain?

I need a little bit of a starting help…

I want to put a door on my terrain when the character opens it , it leads him inside a village then when he goes back it will put him outside the door and not at the starting place where the character first was.

It is a little complicated but I hope you understand.

Thanks alot :slight_smile:

Maybe fill an array with empty game objects, then choose a random game object out of the array, then set your players position to the random game objects position. Example(note that code has not been tested):

public Transform[] points;

void pickRandomSpawnPos() {

     transform.position = points[Random.Range(0, points.Length)].position; 
}