im just missing these two parts for this script that will after 10 seconds of entering the trigger area will spawn multiple units of the selected prefab ( it already spawns 1 after 10 seconds but only in middle) ideally the person will stop in the middle then they all spawn around them.
var enemySpawn : GameObject;
function OnTriggerEnter (other : Collider){
if (other.gameObject.tag == "Player"){
yield WaitForSeconds (10);
Instantiate (enemySpawn,transform.position, transform.rotation);
}
}
¿Why don’t you just do this?
Instantiate (enemySpawn,new Vector3 (transform.position.x -10, transform.position.y, transform.position.z), transform.rotation);
Instantiate (enemySpawn,new Vector3 (transform.position.x +10, transform.position.y, transform.position.z), transform.rotation);
Instantiate (enemySpawn,new Vector3 (transform.position.x, transform.position.y, transform.position.z -10), transform.rotation);
Instantiate (enemySpawn,new Vector3 (transform.position.x, transform.position.y, transform.position.z +10), transform.rotation);
(…)
The 10 is an example, you can changed to your properly magnitude. You can also add as many enemies as you want. If you want a random value of enemies just make a random number and put the instantiate into a while, changing the Vector3 dynamically.