Hey. I am creating location-based game like Pokemon GO. And as I said in topic I want to make random items spawning on the map (but SCPs will be here instead of pokemons). Thanks for any kind of help.
make an array of Gameobjects (public Gameobjets ga) then add every prefab of your pokemons there.
then use something like this
for(int i=0; i < amount_pok; i++) //replace amount by the amount to spawn
{
Gameobject one_pok = Instantiate( ga[Random.Range(0, ga.Lenght-1)] );
one_pok.transform.position = new Vector3( Random.Range(0, 100f), Random.Range(0, 100f), Random.Range(0, 100f) );
}
It will generate a cube of 100x100x100 where randomly will appear.
To put it in ground, use some raycast going from a high altitude to down, and when it collides into ground, apply the Y coordinate of that collision in the one_pok position Y (inside the for).
Or you can just use some rigid body to make fall them into ground by gravity (after spawing in air, the spawing cube must be higher than terrain so they dont spawn under it)