GetRandomInt() not getting the same value again

note that this solution is ok. but has the potential of being increasingly slow. since the more numbers you have picked, the less chances of getting a new number, the more retries. and you never know how many times it will retry maybe 1 maybe 1 million (since it’s random).
It also has the possibility of locking your game if you accidentally request a number when you already exhausted all your possible numbers. (since it will loop forever since there are no more available numbers).

the other 2 solutions are great.

the one to pick a number from a shuffled list has always been very reliable to me, and you can easily check when you exhausted your numbers and reshuffle.
getting a new “random” number is constant in speed. and shuffling an array is pretty easy (and unreal has that functionality built in).

2 Likes