I would like to create a “While Loop” which is completed when a random integer give the good number. The number created id used as index for an boolean array where I want to find a “true” value.
Unknowns: What is the length of the TextureIsUsed array?
Your Random interger, is it set between 0 and TextureIsUsed.length-1?
This may be your problem—> Do you need the random int to be the same int for everywhere it is plugged in? (Currently, each line coming out of the random int will be a different Int, set this as a local var int and then use it several times)