🕹️
AE Expressions
  • What is AE Expressions?
  • Getting started with Expressions
    • Useful links
    • After Effects - Quick Expressions Library
  • Quick Tips
    • After Effects - Arm Rig
    • After Effects - Liquid Smear
    • After Effects - Dynamic Shadows
    • After Effects - Dot Display
    • After Effects Expression - Computer Type-on Animation
    • After Effects Expression - Align Elements on a Path
    • After Effects Expression - Inertial Rotation
    • After Effects Expression - Force Field
  • Advanced Projects
  • After Effects - School of Fish
  • After Effects Expression - Global Wind Controller
  • After Effects Expression - Dynamic Line Waves
  • After Effects - Abstract Space Scene
  • After Effects Expression - Connected Dots
Powered by GitBook
On this page

Was this helpful?

  1. Quick Tips

After Effects Expression - Align Elements on a Path

This is a method that will allow you to align any element or layer to a specific path.

PreviousAfter Effects Expression - Computer Type-on AnimationNextAfter Effects Expression - Inertial Rotation

Last updated 4 years ago

Was this helpful?

Full step by step Tutorial:

Paste this code into the position property of the layers you can to align:

let pathLayer = thisComp.layer("MAIN PATH");
let thePath = pathLayer.content("Shape 1").content("Path 1").path;
let sliderOffset = thisComp.layer("MAIN PATH").effect("OFFSET CONTROL")("Slider");
let offsetRepeat = sliderOffset % 100;
let offsetToAdd = linear(offsetRepeat, 0, 100, 1, 0);

let pathOffset = linear(index, 0, thisComp.numLayers-1, 0, 1);
let myPos = thePath.pointOnPath((pathOffset+offsetToAdd)%1, time);

seedRandom(index, true);
let posSlider = thisComp.layer("MAIN PATH").effect("RANDOM POSITION")("Slider");
let randomPos = random([-posSlider, -posSlider], [posSlider, posSlider]);

toComp(myPos) - thisComp.layer("MAIN PATH").transform.position + randomPos;


/*
Expression by Francisco Giordano, July 2020.
Free for personal use and commercial use.
Instagram @ae.fran.giodano - frangiordano96@gmail.com
*/