i have this expression applied to a flare on a beam effect - it moves the flare up and down the beam.
myAngle = (thisComp.layer("Spark Speed Controller").transform.rotation) / 360;
p1 = (thisComp.layer("Atom Build 1").transform.position);
p2 = (thisComp.layer("Atom Build 5").transform.position);
myVal = 0.5*Math.cos(myAngle*2*Math.PI) + 0.5;
linear(myVal,1,0,p2,p1);
Currently i have to manually edit the start and end points (Atom Build 1 and 5), each time i create a new
beam / spark.
what i want to do i change the start and end points to point at the Beam start and end points of that layer
effect("Beam")("Starting Point")
effect("Beam")("Ending Point")
but whatever i do i can't get it to work...
myAngle = (thisComp.layer("Spark Speed Controller").transform.rotation) / 360;
p1 = (thisComp.layer(effect("Beam")("Starting Point")).transform.position);
p2 = (thisComp.layer(effect("Beam")("Ending Point")).transform.position);
myVal = 0.5*Math.cos(myAngle*2*Math.PI) + 0.5;
linear(myVal,1,0,p2,p1);
where am i going wrong?