I'm looking for a way to change just the Y scale based on the position or distance from a certain point. For example as an object moves further away from the anchor point of another object it scales the Y position (gets slimmer) as it moves away from it.
So far I've found this which does both scale dimensions and only does it to the centre of the comp. Not a specific point / null / layer etc:
Any help is greatly appreciated. Thanks in advance!
pct = .50; // increase by 25%
r = 100; // distance to being increasing scale
center = thisComp.width/2;
p = toWorld(anchorPoint);
d = length(p,[center,p]);
mult = ease(d,0,r,pct,0);
try this: target = thisComp.layer("Null 1"); //change this to the layer you want to target
mul = .001; //change this to effect how much change in scale
d = length( position, target.position );
xScale = mul * value * d;
[ xScale, value, ]
the expression assumes that neither layer is parented (or if they are they are parented to the same layer). if the layers are parented to other layers, we'll need to add a layer-space transform function.