Name your first layer “Leader” (Select layer, “Enter”, name it).
Add a slider control (Effect>Expression Controls>Slider Control. Name the slider “zSpread” (select the slider in the Effect Panel, Enter, name it).
Add your next layer.
Put this expression on Position (Copy the expression, double click the Position Stopwatch, Paste, click outside the expression box):
offset = thisComp.layer(“Leader”).effect(“zSpread”)(“Slider”);
x = thisComp.layer(“Leader”).position[0];
y = thisComp.layer(“Leader”).position[1];
z = thisComp.layer(“Leader”).position[2] + (index-1)*offset;
[x, y, z]
Now if you duplicate that layer they will have the same position as Leader, until you put a number on the slider, then they’ll spread out evenly that much.
Note: They need to be at the top of the layer stack, with leader at the very top.
If you’re not duplicating layers to make you train, select the position for that layer with the expression, then Edit>Copy Expression Only, and Paste onto as many selected layers as you want to have the expression.