Forums › Adobe After Effects Expressions › Connecting two moving layers with a line
Connecting two moving layers with a line
Simon Bonner
February 28, 2008 at 12:44 pmHi,
I have a comp with several small, red dots that move independently. I want to add lines connecting some of these dots so that when the dots move towards/away from one another, the lines reposition themselves to stay ‘stuck’ to the dots.
If I can get this to work, some of the dots will have more than one connection. Perhaps this is important to note, I wouldn’t know being an expression fool.
Any ideas would be greatly appreciated!
Simon Bonner
youtube.com/simonsaysFXDarby Edelen
February 28, 2008 at 4:48 pmYou can use a Generate > Beam effect on a full-screen solid to draw a line between two points, all that remains is finding out the starting and ending point of the line:
Starting Point:
l = thisComp.layer("beginDot");
l.toComp(l.anchorPoint);
Ending Point:
l = thisComp.layer("endDot");
l.toComp(l.anchorPoint);
Darby Edelen
Designer
Left Coast Digital
Santa Cruz, CALloyd Alvarez
February 28, 2008 at 4:50 pmUse the beam effect on a comp sized layer and pickwhip the Starting and Ending Points to the position of your dots.
-Lloyd
Kyle Reynolds
August 25, 2011 at 4:39 pmTried this with the position value of a text layer so far, didnt work.
Dan Ebberts
August 25, 2011 at 5:38 pmIn what way? Do your text layers have parents?
Dan
Log in to reply.