Random Int in Range duplicating numbers?

Hi.

Having an issue thats a bit hard to track down.
Occasionally my array is missing an item.

Sometimes it would be 1, other times it would be 2 items missing.
I then noticed a mistake where i set random int in range from 0-38.

The array contains only 38Items.
So i set the random into in range to 0-37

This got rid of the 2 items missing.
But now there are occasionally 1 item missing.

Is it possible that Random Int in Range selects a number twice occasionally?

Ahh i printed it to the screen on the forloop and it does in fact bring the same int at occasions. Will have to do some check and for every duplicate i need to rerun one loop atleast or perhaps more for every duplicate entry

Im not sure if this is the best way to go about it. But it works.

I get the Int’s it randomly selected and write it to an array at the end of the loop body, and then during the loop it checks if that int was already selected. If it was (false) then i just rerun that specific loop body and not the entire loop)

Hello,
I got sometimes troubles with some random int in range and when i did a “set” and used the “get” result to set i solved it.

Edit : i even used a rand to get a var in an array and use this array result, and got same multi issue. Only setting a var and use this var solved it.

Hi

I did a test earlier, strange results.