<p>Figured out how to do it with expressions. You need to know the time taken for a full rotation and the number of degrees you want to increment.</p>

<pre><code>degrees = 6; // Number of degrees to rotate by
fullRotationTime = 60000; // Number of milliseconds to complete a full 360 degree rotation

steps = 360/degrees; // Number of steps in one rotation  
divisor = fullRotationTime / steps; 

ms = 1000*time; // Milliseconds since start
degrees*(Math.floor(((ms)/divisor)%steps))
</code></pre>

<p>This example will "tick" once a second for 60 seconds. </p>

CC BY-SA 3.0
2015-04-23T14:28:14.740Z
2015-04-23T14:34:40.140Z
2015-04-23T14:34:40.140Z
Ben
<p>I want to animate a representation digital counter. It is a segmented circle, and each time the counter increments it should move one step forward.</p>

<p><img src="https://i.sstatic.net/gwmas.png" alt="enter image description here"></p>

<p>My plan is to start with a graphic with all the segments visible, and then use a mask to block out the "selected" segment - it should look like a digital sweep around the circle.</p>

<p>I can do this with rotation quite easily, but it will be "analogue", in that it will reveal parts of the segment rather than make a discrete change. How can I make an object rotate snappily by x degrees every second, rather than smoothly rotating?</p>

<p>Only way I can think is to use expressions, and set a stepped value, but is there a better (simpler) way?</p>

<after-effects>
How can I rotate in steps with After Effects?
Ben
# How can I rotate in steps with After Effects?

(Asked by: username_0 on 2015-04-23)

I want to animate a representation digital counter. It is a segmented circle, and each time the counter increments it should move one step forward.

![enter image description here](https://i.sstatic.net/gwmas.png)

My plan is to start with a graphic with all the segments visible, and then use a mask to block out the "selected" segment - it should look like a digital sweep around the circle.

I can do this with rotation quite easily, but it will be "analogue", in that it will reveal parts of the segment rather than make a discrete change. How can I make an object rotate snappily by x degrees every second, rather than smoothly rotating?

Only way I can think is to use expressions, and set a stepped value, but is there a better (simpler) way?

**Tags:** after-effects


---

## 1 answers

### Answer by username_0 on 2015-04-23. Score: 2

Figured out how to do it with expressions. You need to know the time taken for a full rotation and the number of degrees you want to increment.
degrees = 6; // Number of degrees to rotate by
fullRotationTime = 60000; // Number of milliseconds to complete a full 360 degree rotation

steps = 360/degrees; // Number of steps in one rotation  
divisor = fullRotationTime / steps; 

ms = 1000*time; // Milliseconds since start
degrees*(Math.floor(((ms)/divisor)%steps))

This example will "tick" once a second for 60 seconds.


---

