🕹️
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?

After Effects - School of Fish

Here you'll find the tutorial and expressions for the School of Fish Animation. This animation uses a combination of valueAtTime() and random() Expressions.

PreviousAfter Effects Expression - Force FieldNextAfter Effects Expression - Global Wind Controller

Last updated 4 years ago

Was this helpful?

Full Tutorial:

Code for the position of the fish:

var timeDisp = thisComp.layer("CONTROLLER").effect("time displacement")("Slider");
var xDisp = thisComp.layer("CONTROLLER").effect("xDisp")("Slider");
var yDisp = thisComp.layer("CONTROLLER").effect("yDisp")("Slider");
var zDisp = thisComp.layer("CONTROLLER").effect("zDisp")("Slider");

seedRandom(thisComp.layer("CONTROLLER").effect("seed")("Slider"), timeless = true);

var myTimeDisp = random(0, timeDisp);
var myXDisp = random(-xDisp, xDisp);
var myYDisp = random(-yDisp, yDisp);
var myZDisp = random(-zDisp, zDisp);
var posDisp = [myXDisp, myYDisp, myZDisp];

thisComp.layer("CONTROLLER").transform.position.valueAtTime((time - myTimeDisp)) + posDisp;