GameObject range

Hi evryone,

I am making a script who is using an array of several game objects.
I am creating the array in a function, and want to access it in anothe, but my noob programming skill sdon’t help me on that.

Here is my script:

#pragma strict
var slow = 3.0;
var range = 3.0;
var freezeTime = 1.0;
var explosion : GameObject;

private var startFreeze = 0.0;
private var fooObj : GameObject in GameObject;


function OnTriggerEnter (other:Collider) {

Instantiate(explosion,transform.position,transform.rotation);

	
for(fooObj : GameObject in GameObject.FindGameObjectsWithTag("enemy"))
{
	startFreeze = Time.time;
	if (Vector3.Distance(fooObj.transform.position, transform.position)< range)
	fooObj.GetComponent(enemy_move).moveSpeed /= slow;  
}

Destroy(gameObject);

}


function Update ()
{

	if( Time.time> startFreeze + freezeTime)
	{
	fooObj.GetComponent(enemy_move).moveSpeed *= slow;  
	}
	


}

Thanks a lot in advance

private var fooObj : GameObject in GameObject;

What? No. I don’t think this is legit.

Sorry if I don’t use the good terms. As said, I am not a programmer, I jsut learned by myself.

So what I wanna do is, on trigger enter, get all the game objects in a certain range, and change one of their variable’
Then, after X seconds, change this same variable.