Why is math.random not working

Oh wait, I think I see what you’re trying to do, and why it’s not working.
I misunderstood your original post. Apologies.

setInterval doesnt re-evaluate the timer on every loop - it resolved your random value, came up with a number (somewhere in the range of 2000-2099), and said “every X milliseconds, run this function.”

What you’re doing here, is start a function. That function sets a new timer, which re-evaluates the random modifier, every loop.

1 Like