Skip to main content
Participant
June 26, 2021
Answered

Rotation (Y rotation)

  • June 26, 2021
  • 2 replies
  • 552 views

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

This topic has been closed for replies.
Correct answer Dan Ebberts

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

 

2 replies

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
June 26, 2021

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

 

Participant
June 26, 2021

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

Mylenium
Legend
June 26, 2021

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