Position Array

I’ve asked this question before, but I still can’t really figure it out. Arrays are one of my biggest weaknesses.

I’ve got an array with objects in it. I want another array to store their Z positions, so later on I can move them back to those positions. I can’t figure out how to do this, if someone could make an example script, that would be awesome.

Thanks in advance,
Daan

I hope you are trying this. Try this:

var a = new Array(A : GameObject,b : GameObject,c : GameObject);
var b = new Array(40,50,60);
function Update(){
a[0].transform.position.z = b[0];
a[1].transform.position.z = b[1];
a[2].transform.position.z = b[2];

}