ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# clock second hand ticking

FAQ   •   VIEW ALL
 clock second hand ticking on Oct 23, 2009 at 8:23:11 pm

I have a clock face with a second hand that rotates 360degrees over one minute.
I would like to have the hand "tick" not smoothly rotate.
I suppose I could change the frame rate of my comp but how would I do this with an expression as in
"rotate 1 degree every second for one minute"
30 fps comp

 Re: clock second hand tickingon Oct 23, 2009 at 8:54:50 pm

Simplest thing is you can make it rotate from the beginning of N second to N+0.2 second (smoothly) so within every second, it first rotates very quickly, then take a rest for the remaining 0.8 sec, here is the rotation property's expression for that (assuming you've already moved the anchor point of the hand to one of its end at the clock face center):

```wholeSecond = Math.floor(time); rotateDuration = 0.2; anglePerSecond = 6; // 360 / 60 startAngle = wholeSecond * anglePerSecond; linear(time, wholeSecond, wholeSecond + rotateDuration, startAngle, startAngle + anglePerSecond)```

Xinlai Ni

 Re: clock second hand tickingon Oct 23, 2009 at 8:58:06 pm

The above expression makes the second hand tick at the beginning of the second, I think in reality, you want it to tick at the end of every second, just replace the linear expression with this one
`linear(time, wholeSecond + 0.8, wholeSecond + 1, startAngle, startAngle + anglePerSecond)`

Xinlai Ni

 Re: clock second hand tickingon Aug 7, 2015 at 2:31:47 pm

Nice! Is there a way to give it a little 'wiggle'at the end of echt stroke? So the second hand feels a little bit more bouncy wenn it hits a new second.

 Re: clock second hand tickingon Jan 21, 2018 at 5:34:36 pm

No need to add wiggle, just replace linear to ease

```wholeSecond = Math.floor(time); rotateDuration = 0.2; anglePerSecond = 6; // 360 / 60 startAngle = wholeSecond * anglePerSecond; ease(time, wholeSecond, wholeSecond + rotateDuration, startAngle, startAngle + anglePerSecond) ```

 Re: clock second hand tickingon May 5, 2013 at 2:59:35 pm

Hi,

I found this expression of yours (with its amendment) and really like the movement it produces. Thanks.
Is there any way (as a non-coder), I could use the output of this to move a null a specified number of pixels on the x axis "in sync" with the ticking second hand.

So, in layman's terms: every tick os the clock, moves the null 20px to the left, but with the same timing that this script produces (ie, at the "end of the second"? I'm basically trying to make it look like the second hand is locked to — and "driving" — a flat panel across the screen)

If you're still around I'd love to know how to do this.

Many thanks.

(And to Dan Ebberts, your far simpler expression is, as always, so elegant, but on anything uniform, like a cog, produces no sense of movement. The cog turns, but one doesn't get a sense of it actually turning... If that makes sense)

 Re: clock second hand tickingon May 6, 2013 at 5:57:37 pm

I would think something like this should work:

clock = thisComp.layer("clock");
value - [clock.transform.rotation*20/6,0]

Dan

 Re: clock second hand tickingon Oct 23, 2009 at 11:13:15 pm

Try this:

Math.floor(time)*6

Dan

 Re: clock second hand tickingon Oct 10, 2011 at 2:12:10 am

cheers Dan, this worked perfectly out of the box. Thanks to Google for finding this thread for me. Problem solved in seconds flat :)