## Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.

• Rotation (Y rotation)

# Rotation (Y rotation)

New Here ,
Jun 26, 2021 Jun 26, 2021

Copied

Hi everyone,

I'm doing a projet that I'd like to rotate (Y rotation) towards the left (speed 20) for 2.1 seconds then I'd like it to go back to initial position and create a loop.  For now I have added time*20 to the "Y rotation" module what expression should I use to create the desired loop?

Thank you very much for your input!

VB

TOPICS
Expressions

Views

140

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Guide , Jun 26, 2021 Jun 26, 2021
Probably like this:t = time%2.1; t*20or like this if you need it to ping pong:dur = 2.1; t = time%dur; n = Math.floor(time/dur); (n%2 ? dur-t : t)*20

Likes

3 Replies 3
Jun 26, 2021 Jun 26, 2021

Copied

Nothing to add because this is not how these expressions work and to be honest your workflow is just terrible. Instead create two linear keyframes with the respective values, one at zero and one at 1 second and apply a loopOut(cycle) expression.

Mylenium

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Guide ,
Jun 26, 2021 Jun 26, 2021

Copied

Probably like this:

``````t = time%2.1;
t*20``````

or like this if you need it to ping pong:

``````dur = 2.1;
t = time%dur;
n = Math.floor(time/dur);
(n%2 ?  dur-t : t)*20``````

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Jun 26, 2021 Jun 26, 2021

Copied

LATEST

Wow awesome thanks!!! It works!!

However, my main composition no longer takes the timing of another composition into consideration.

Let me explain: Lights on the UFO should start 3 seconds (screenshot "2") ...

... however they are visible on the main composition from 00:00 (screenshot "1").

Do we know why? It never happened to me before.

Thank you again for your help! That's awesome to get input from this community!

VB

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources
Troubleshooting FAQs
After Effects Community Recap
Getting started with After Effects