Forums › Adobe After Effects Expressions › Control Scale with a Null
-
Control Scale with a Null
-
Simon Terrey
March 1, 2023 at 3:37 pmHi there! I used to use this expression to control an objects scale with a Null but it no longer works in CC2023:
AE says: Line 7 (dis = length…) is at fault. Has the expression language changed?
mouse_layer = thisComp.layer(“Scale_Control”);//Mouse layer
beginScale = [100,100]; //
endScale = [50,50]; //
beginDistance = 200;//Distance to begin magnifying in pixels
endDistance = 0;//Distance to end magnifying in pixels
//–Don’t modify below here
dis = length(this.position, mouse_layer.position);
ease(dis, beginDistance, endDistance, endScale, beginScale);
-
Dan Ebberts
March 1, 2023 at 4:46 pmTry changing this line:
dis = length(this.position, mouse_layer.position);
to this:
dis = length(position, mouse_layer.position);
-
Simon Terrey
March 1, 2023 at 5:08 pmAmazing! When I turned ‘Legacy ExtendScript’ on in Expressions in Project Settings the old script worked but yours works fine in JavaScript.
Thank you so much Dan!
Log in to reply.