From the course: After Effects: Using Expressions

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

JavaScript math

JavaScript math

- The math functions available in JavaScript can simplify mathematical operations, such as rounding up or down, or generating random numbers. These functions are readily available in the expression language menu, making them easy to use in expressions. Let's try out a few examples and explore the possibilities. In After Effects, open the composition named 4.4 JavaScript Math, which is the composition I have opened here. Let's go ahead and add an expression to the position of this layer. So, select it, press P for position, add the expression, and type the following. A space equals space, B space equals space, C space equals space, and we're going to put A and B together here. For A, we're going to look at itself. For B, we're going to have the wiggle. And it's going to go to 100. And of course, this is going to be to the array index one. And let's not forget the semicolons. And there you go. So, the y position is…

Contents