Move in x every [10] frames?
Hi!
Trying to figure out how out how to script this:
• Move an object forward in x every [45] frames the whole time of the comp. And no movement at all.
I tried doing this setup:
----------
length = Math.floor(thisComp.duration);
lengthFrames= timeToFrames(length);
cycle = lengthFrames/thisComp.layer("Null 2").effect("Value")("Slider");
tid = Math.floor(timeToFrames(time));
if (tid % cycle == 0) {
transform.xPosition +10;
}
----------
(I used a null layer with a slider for easier debugging and so I can change the value on the fly later.)
The equation results in 0 every 45th frame – which is good but the movement happens every frame. I can't figure out how to trigger a certain movement just on that occasion and nothing else!
Somebody in here that has a suggestion how to solve this?
Best
