Spawning player at appropriate point in random model of a city using only the mesh data.

I have a random .obj model of a city of random size and I want to spawn my character in an appropriate place which should basically be at a lower height and should be a flat part of the city without any obstructions around it. How can I identify what points in the model are good for spawning using only the mesh of the model ?

I don’t know if it’s the best way, but one solution is:
1-Create a spawn area;
2-Cast multiple ray casts in direction of the ground;
3-Spawns the player in the most low Y collision;

You can also make use of layer masks to make the raycast only detect valid surfaces to your player spawns!
174237-sem-titulo-1.jpg