I'm trying to make an expression where I have multiple "Beam" effects and they're going to connect to circles. The circle layers are called "Circle 1, Circle 2, Circle 3...etc". What I want to do is make the start point of the "Beam" effect, which is (Index 1) connect to the position of "Circle 1" and the end point to connect to (Index + 1) so "Circle 2". Essentially I could copy the beam layer for as many circles I have and they should just connect automatically.
An incorrect example would be like:
(In the Starting Point attribute of the "Beam" effect)
(In the Ending Point attribute of the "Beam" effect)
for the start point: target = thisComp.layer(index + 1) ;
for the end point: target = thisComp.layer(index + 2) ;
this would connect the beam start point to the the first layer (circle) bellow the layer that the beam effect is on, and connect the end point to the second layer bellow the beam effect layer.