Instantiate number of enemies

hi I'm trying to spawn more monster after 1 is defeated, so I wrote this script, but I couldn't figure it out what is wrong, or how to fix it. Please Help! I'm not originally a game programmer so I found this hard to do. and I want 3 number of objects to appear immediately after the first one is destroyed. that var childrenspawn : zombie = spawns *seems to give me error whatever I put there.

* *

Thanks

* *

var zombie : Transform;

* *

function Update()* *{

* *```* *var spawns = GameObject.Find("zombieSpawnPoint");* *if(BiggerZombieAI.Eliminated)* *{* *for (var i=0;i<3;i++) {* _var childrenspawn : zombie = spawns*;*_ _*Instantiate(zombie, childrenspawn.transform.position, childrenspawn.transform.rotation);*_ _*```*_ _*

}

*_

What is zombieSpawnPoint? GameObject.Find will only return one gameobject, but spawns *implies that it will return more than one.

* *

If zombieSpawnPoint is simply a single location that you'd like to create three zombies at then try this:

* *```* *var zombie : Transform;* *function Update() {* *var spawns = GameObject.Find("zombieSpawnPoint");* *if(BiggerZombieAI.Eliminated)* *{* *for (var i=0;i<3;i++) {* *Instantiate(zombie, spawns.transform.position,* *spawns.transform.rotation);* *}* *}* *```* *

Unfortunately, this code will create all three zombies at the same location, so you may want to randomize their spacing a bit.

* *

Be aware that GameObject.Find shouldn't be placed in an Update() function due to speed. You can use this code for testing, but you should really find it once in your Start() function and save it.

*

I have found a way to do it, thanks for your answer without your answer I wouldnt be able to figure it out, although now I need to know how to make space out of them Thanks

var zombie : Transform;

function LateUpdate() {

    var spawns = GameObject.Find("zombieSpawnPoint");
        if(BiggerZombieAI.Eliminated)
    {
            for (var i=0;i<3;i++) {
        Destroy(spawns.gameObject, i);
            Instantiate(zombie, spawns.transform.position, 
                spawns.transform.rotation);
        }
}

        }