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.
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;
Last updated
Was this helpful?