Time

A simple time-based expression that creates continuous motion or animation without keyframes.

Author:
Denis Stefanides
Category:
Time

Expression Code

time * 100
// Multiplies the current comp time (in seconds) by 100
// So the value increases by 100 every second
// You can replace 100 with any number to control speed
jsx

Where to Apply

Apply this expression to:

  • Rotation

  • Position (X or Y separately)

  • Scale (individual axes)

  • Opacity (used with extra math like sine)


How It Works

The time expression tracks how many seconds have passed in your composition. So when you multiply time by a number, you're creating a value that grows steadily over time.

For example:

  • At 0 seconds → value = 0

  • At 2 seconds → value = 200 (if using time * 100)

This is perfect for making things move or change automatically, without setting any keyframes.

Time Expression on Position

[value[0] + time * 100, value[1]]

// Moves layer to the right over time
// Adds 100 pixels every second to X (horizontal position)
// Keeps Y (vertical) position unchanged
jsx

Time Expression on Rotation

time * 45
// Rotates the layer 45 degrees per second
// Change 45 to go faster or slower
jsx

Time Expression on Opacity (with pulsing effect)

Math.sin(time * 2) * 50 + 50 

// Creates a looping sine wave
// Opacity goes between 0 and 100
// Sine outputs values from -1 to 1 → scaled to 0–100
jsx

Time Expression on Scale (slow zoom effect)

[ value[0] + time * 10, value[1] + time * 10 ]

// Gradually increases both width and height
// Adds 10 units to X and Y scale every second
// Keeps the aspect ratio steady
jsx

Frequently asked questions

How do I use the expression on this page?

Just copy the full expression code from the top of this page. Then Alt-click (or Option-click on Mac) the stopwatch on the property you want to animate. Paste the code into the editor and that's it. If you’re not sure which property to use, check the "Where to Apply" section above.

The expression isn’t working. What should I check?

First, make sure your project is using the JavaScript engine (go to File > Project Settings > Expressions). Also double-check for missing characters, and see if the code requires parenting a layer. If so, there will be a comment in the code explaining what needs to be connected.

I’m not sure what the expression does. Where can I learn more?

Take a look at the "How It Works" section on this page. It explains each part of the expression in plain language so you can understand how everything works together.

Can I customize how the expression behaves?

Yes, absolutely. Most expressions include easy-to-edit variables near the top and comments that guide you on what to change. You can also link sliders or checkboxes using Expression Controls if you want more control in the timeline.

Can I apply this to other properties too?

Yes, you can use it on any property with a stopwatch. That includes Position, Scale, Opacity, and also effect settings like Blur or Tint.

Will it work in comps with different frame rates or sizes?

In most cases, yes. These expressions are designed to adapt to your comp’s resolution and frame rate. If anything specific needs adjusting, it’ll be noted in the code or in the "How It Works" section.

Related Expressions

Explore more expressions in this category