-
Dumper truck w. Hydraulic arm
Hi,
I’m trying to link this hydraulic pole of the loading bit of a dumping truck.

..That “loading bit” is lifted and the pole consisting of two parts extends out.
I’ve managed to tie the bottom part of the hydraulic arm to the top bit, with this expression..
c = thisComp.layer("Medium Red Solid 2");
offset = effect("Slider Control")("Slider");
otherDimension=c.to_comp(c.anchor_point);
diffx = thisLayer.position[0]-otherDimension[0]
;
diffy = position[1]-otherDimension[1];
if (diffx == 0) {diffx = 1 }sign = 1 + (-1 * (diffx / Math.abs(diffx))) * 90;
radians_to_degrees(Math.atan(diffy/diffx)) + sign + offset
That way It always looks at where hydraulic part 2 is connected. Unfortunately I can’t get the upper part to look at the lower.My apologies for writing a messy post. I added the image in an attempt to clarify the problem.