Make an expression run every few seconds
I am trying to create a jittering effect for an object in after effects. To do this I used an expression to generate random values between specific cordinates for the position. The problem is this code is executing every single frame so it looks terrible. To avoid this I tried using if/then statements using time. However, I keep getting errors stating that time is an undefined value. If there is a way to fix my code or a simpler way to accomplish the same goal please let me know.
Here is my code:
if(time == 0){
p = [960,540];
}else{
if((time % 2) == 0){
p = random([950,530],[970,560]);
}
}
p;
