Variables
A variable stores a value. Use var or let. Example: let amp = 40;
Arrays
Position is an array of two numbers: [x, y]. You can change one part: [value[0] + 100, value[1]] moves 100 pixels right.
if Statements
An if makes a choice. Example: if the time is over 2 seconds, change the opacity.
linear and ease
linear(t, tMin, tMax, value1, value2) maps a time range to a value range. ease() does the same with smooth ends.
time 0 linear: 0 ease: 0 | time 1 linear: 0 ease: 0 | time 1.5 linear: 25.0 ease: 15.6 | time 2 linear: 50.0 ease: 50.0 | time 2.5 linear: 75.0 ease: 84.4 | time 3 linear: 100 ease: 100 | time 4 linear: 100 ease: 100
Both start at 0 and end at 100. At time 1.5 the ease value is lower than the linear value, because ease starts slowly.
valueAtTime and index
thisComp.layer(index - 1).transform.position.valueAtTime(time - 0.1)makes a layer follow the layer above it with a 0.1 second delayindexis the layer number, so you can offset animation per layer usingindex * 0.1
Practice
- Fade a layer in with linear between seconds 1 and 3
- Make a chain of 8 circles follow each other with valueAtTime
- Use if to change a color after 5 seconds
- Rewrite a keyframe animation as an ease expression
Conclusion
Variables, arrays, if, linear, ease and valueAtTime give expressions real power.

