|
Hello, I'm working on a music player for my game, what it does, is it randomly selects 1 out of 5 songs by using Random.Range. The problem is that sometimes, Random.Range selects the same number it previously selected, thus playing the same song. How do I prevent Random.Range from selecting a value it previously chose?
(comments are locked)
|
|
I'd use a list to keep track of used values. Also, not that Random.Range( int, int ) is [inclusive, exclusive], so you need to use (1, 6);
(comments are locked)
|
