Skip to content

Instantly share code, notes, and snippets.

@Wunkolo
Wunkolo / Mystery.js
Last active July 14, 2022 02:07
Spiderman home-coming mystery code solved
targetPos = thisComp.layer("target").toComp([0,0]); // Compensating for the missing "targetPos" variable
box = thisComp.layer("box");
boxTopLeft = box.toComp([0,0]);
boxBottomRight = box.toComp([box.width,box.height]);
// this is erroneous on their part. "deltaX" and "xDistanceToEdge" does not exist yet, commented out.
boxAnchor = box.toComp(box.anchorPoint);// xRatio = deltaX/xDistanceToEdge;
deltaVec = sub(targetPos, boxAnchor)
deltaX = deltaVec[0];