@meto396 what is the range of the knob? seeing your array length is 5, the knob has to be 0-4 with stepSize=1
If you intend to use different step values, there are other ways to do this without an array.
const var NB_STEPS = 5;
// later in your functions
local index = Math.round(value * NB_STEPS) / NB_STEPS; // output -> 0.0, 0.2, 0.4...