-
Distance Travelled Expression
I am trying to generate an accumulation for distance travelled.
Knowing that Time x Speed = Distance
The code attached is successful in accumulating my speed but I now need to add a valueAtTime multiplier to get my distance.
Can anyone help shine a light?
Many thanks in advance – Chris
// time x speed = distance //spd = comp("- CNTL - MPH -").layer("- MPH -").effect("MPH")("Slider");
accum = 0;
for (f = timeToFrames(inPoint); f <= timeToFrames(); f++){
accum += spd.valueAtTime(framesToTime(f));
}
s = value + accum;[s]
Christopher Johnstone