Question about Instantiate?

Hi,

I’m using this script to Instantiate my objects:

var newobject : GameObject;

function OnTriggerEnter (other : Collider) {
	var position1 = Vector3(Random.Range(-5, 5), 0, ?????);
    Instantiate(newobject, position1, Quaternion.identity);
}

Where I’ve put the question marks above, instead of just putting a single value in is there a way I can say; make the newobject 20 meters in front of this one?

If I make any sense…

Thanks,
Stuart

Well, if you mean twenty points in z ahead of the object with the script on it, that’s transform.position.z + 20. If you mean twenty points ahead of the position chosen last time, that would require a variable that increases by one every instantiation. Then you’d just do that variable * 20 + starting position.