Download

Question about random numbers

Hello and thanks preemptively!

I have this weird interaction when I loop through an array. Basically, what I am trying to do is loop through an array, pick one element, and then do a function with it. For some reason the statement I use to check if the index of the array is the same as the random number I use to get that index from isn’t always the same (see pictures for more).

help2.PNG
If everything would have worked correctly it would have printed 22 or 11 or 00 to the screen.

Have anyone encountered something similar? Helping me out here would be super kind.

Hi man
The node , random interget in range,
will release every time a new random,
for example, you access it 2 times for loop, 1 the branch and 2 print-append
both the times he will roll a random,

Try making 5 print, always connected to the same random integer in range,

if you want to use a random number for multiple times, you need to save it.

You can set the random number as a variable and set that variable as the max number. By doing that, you will have one unchanged max number, instead of constantly, randomly changing max number.