There are a couple of possibilities. If you want your layers to move based on movement of the null, you can apply expressions like these:
p = thisComp.layer(“Null 1”).transform.position;
x = (p – p.valueAtTime(0))[0];
value + [x,0]
and
p = thisComp.layer(“Null 1”).transform.position;
x = (p – p.valueAtTime(0))[0];
value – [x,0]
This causes one layer to mimic any keyframed movement of the null in the x direction and the other layer will go the opposite direction.
That may not be what you meant though (this doesn’t do anything until you keyframe some movement of the null). Another possibility would be to have the layers move in response to the Null’s distance from a fixed point.
Let’s say you want the layers to respond to the null’s distance from the center of the comp. That would look like this:
p = thisComp.layer(“Null 1”).transform.position;
x = p[0] – thisComp.width/2
value + [x,0]
and p = thisComp.layer(“Null 1”).transform.position;
x = p[0] – thisComp.width/2
value – [x,0]
Dan