Getting Objects in a scene problem.

Ok so i have a slight problem. Ive been developing a game and i made a script that spawns zombies. I have another script that is supposed to get all the zombies that are currently in the scene and set them to inactive as well as the actual zombie spawner. Unfortunatly when i pause the game the last zombie spawned seems to be unaffected and isnt set to inactive. Here is the code that is suppose to set the zombies to inactive.(This is not the entire script this the parts dealing with the zombies.)

public GameObject[] zombies;
public GameObject zSpawner;

void Start(){
    zSpawner = GameObject.Find("Zombie Spawner");
}

void Update(){
    if(Input.GetKeyDown("p")){
	zSpawner.active = false;
	for(int i = 0; i<zombies.Length+1; i++)
	{
		zombies*.active = false;*
  •   }*
    
  •   for(int i = 0; i<zombies.Length+1; i++)*
    
  •   {*
    

_ if(zombies*.active)_
_ zombies.active = false;
}
}
void AddZombie(GameObject zombie)
{
zombies = GameObject.FindGameObjectsWithTag(“Zombie”);
}
Thanks in advance
Here is an excerpt from another that calls AddZombie()
public GameObject playerCam;
void Start()
{
playerCam = GameObject.Find(“Main Camera”);
playerCam.SendMessageUpwards(“AddZombie”, gameObject);
}*_

Try like this:

public GameObject[] zombies;
public GameObject zSpawner;

void Start(){
    zSpawner = GameObject.Find("Zombie Spawner");
}

void Update(){
    if(Input.GetKeyDown("p")){
    zSpawner.active = false;
    for(int i = 0; i<zombies.Length; i++)
    {
       zombies*.active = false;*

}
}
void AddZombie(GameObject zombie)
{
zombies = GameObject.FindGameObjectsWithTag(“Zombie”);
}

Did you try setting Time.timeScale to 0 when pausing instead of that code?