Copy link to clipboard
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
1 Correct answer
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
Copy link to clipboard
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
Copy link to clipboard
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
Copy link to clipboard
Copied
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

