Object Following A Moving Bezier Graph

It does :partying_face: Can’t thank you enough for all your help!! :pray:

One last thing the last set of changes means we don’t need the if statement in drawTrace() so we have

void drawTrace() {
  stroke(traceCol);
  strokeWeight(16);
  float prevX, prevY, currX, currY;
  int pos = max(1, startIdx);
  prevX = pos * traceStep;
  prevY = trace[pos] * maxAmp;
  for (; pos < trace.length; pos++) {
    currX = pos * traceStep;
    currY = trace[pos] * maxAmp;
    line(prevX, midH + prevY, currX, midH + currY);
    prevX = currX;
    prevY = currY;
  }
}

Glad to have helped :grinning:

Thanks for the hint :slight_smile: