This works for the first rotation. The number increments in one frame. What I would like to do is reset
yPosition in the else statement to the value it started with in the script. Is there a way to do this?
Seems as though every frame the code is executed from the start of the script. Just not sure how to do this?
//Use the needle to position the numbers
// to get the .72 I divided 36 degrees the amount it takes to get to 1 by 50 pixels the height of the number box
//from dan yPosition = thisComp.layer(“NEEDLE”).transform.rotation/0.72%360;
// from dan [value[0], yPosition-105]
//I believe 500 is the height of the graphic from the bottom to bottom of zero check scrnum4.ai file
//mutitply by .1 to slow it down for the thousands had to add a zero to 500 so it wouldn’t flip over
//% is the JavaScript modulus operator. x%y returns the remainder that results from dividing x by y. Very useful for translating a continuously growing value into a cyclic one FROM DAN creative cow
// good one yPosition = thisComp.layer(“NEEDLE”).transform.rotation/0.72%5000*.1;
yPosition=thisComp.layer(“NEEDLE”).transform.rotation/0.72%5000/500;
yTempPosition=Math.floor((thisComp.layer(“NEEDLE”).transform.rotation/0.72%5000/500));
if (yPosition < 1){
( yTempPosition )
}else{
yTempPosition=yTempPosition + 50;
// reset yPosition back to its original value here
// not sure how to set up this kind of value
}
// [value[0], yPosition-81];
[value[0], yTempPosition-81];