-
if then else snafu
Hello,
I’m making an altimeter and I have a needle revolving around a face
I have a scroll wheel with 10 numbers on it (essentially) that match the rotation of the needle
trouble is my graphic has only 10 numbers 0 thru 9
I would like to reset it once it makes one complete revolution or in this case
once I have translated the graphic all the way to the top. I would like to put it back
in its starting positionThe following scripts works great until I get to the top of the sequenced numbers graphic
it just keeps going right off the screen.
I thought an “if then” statement would work.
I don’t get any errors with this but I dont’ get the behavior I’m looking for either.Thanks for your help.
//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 letter box//by the height of the letterbox 50 pixels
yPosition = thisComp.layer(“NEEDLE”).transform.rotation/0.72;
// set the yposition and test to see if it goes out of range if so restart it
pt = [value[0], yPosition-105]
if (pt > 395) pt = -105;
pt