Random AI spawning, random object spawning


I have a question, in left for dead 2 they have random spawning of objects/weapons and zombies/AI ex: the AI and weapons are in different areas each time you join a different game and some times a area is blocked off when you join a game then the next time you join it is not blocked off, so my question is how would you make random spawning like in left for dead 2 if you have any idea on any of the three things im asking please replay, random zombie spawn, random objects, random barricades,

Using Random you can randomize anything you want.

Get a ramdom zombie from a zombie list:

GameObject randomZombie = zombieList[(int) (Random.value * zombieList.Lenght));

Or position in a random position: (assuming your level is 100x100)

zombie.transform.position = new Vector3(Random.value * 100, 0, Random.value * 100);

Or anything at all… have fun! :slight_smile: