MENU

Fun & Interesting

Automatic Proximity Reactions in After Effects

olly 61,351 lượt xem 3 months ago
Video Not Working? Fix It Now

Get $50 off Motion Array’s Annual Plan here: https://motionarray.com/?artlist_aid=Oliviero_3293&utm_source=affiliate_p&utm_medium=Oliviero_3293&utm_campaign=Oliviero_3293

Big thanks to Motion Array for sponsoring this video! Motion designers, don't miss out—subscribe to their service using the link above for access to thousands of video and graphics assets.

Download my free resources and tutorial files here: https://ollyos.gumroad.com

Instagram: / oliviero_s
TikTok: / oliviero_s

Subscribe to the channel and drop a comment with any motion design topics you'd like to see covered next.

Tutorial Expressions:

INFLUENCE POSITION

nullPos = thisComp.layer("NULL").transform.position;
objPos = transform.position;
maxDist = thisComp.layer("CONTROLLER").effect("Max Distance")("Slider");
strength = thisComp.layer("CONTROLLER").effect("Strength")("Slider");
dist = length(nullPos, objPos);
dir = normalize(objPos - nullPos);
moveAmount = strength * (1 - clamp(dist / maxDist, 0, 1));
newPos = objPos + dir * moveAmount;
newPos;

INFLUENCE TIME REMAP

nullLayer = thisComp.layer("NULL");
distance = length(nullLayer.position, transform.position);
maxDist = thisComp.layer("CONTROLLER").effect("Max Distance Time")("Slider");
strengthDist = thisComp.layer("CONTROLLER").effect("Strength Time")("Slider");
effectiveDist = clamp(strengthDist, 0, maxDist);
timeStart = 0;
timeEnd = 5;
clampedDistance = clamp(distance, effectiveDist, maxDist);
remapTime = linear(clampedDistance, maxDist, effectiveDist, timeStart, timeEnd);
remapTime;

EFFECTS ANGLE

nullPos = thisComp.layer("NULL").transform.position;
objPos = thisLayer.transform.position;
angle = -radiansToDegrees(Math.atan2(objPos[1] - nullPos[1], objPos[0] - nullPos[0])) + 180;

EFFECTS OPACITY:

nullPos = thisComp.layer("NULL").transform.position;
objPos = thisLayer.transform.position;
maxDist = thisComp.layer("CONTROLLER").effect("Max Distance")("Slider");
dist = length(nullPos - objPos);
opacity = 100 * (2 - 2 * clamp(dist / maxDist, 0, 1));

00:00 Intro
00:38 Influence Position
02:40 Motion Array
03:50 Influence Offset
05:26 Influence Time
07:10 Influence Offset
08:38 Influence Effects
11:30 Outro

Comment