You must log in or register to comment.
Good tip, just also good to remember there’s no way to control the seed of the generator, for example for a seeded world.
For that use case you still need to manually run the generator you created with your seed to select an item.And in case you’re trying to play random sounds: you can use
AudioStreamRandomizer
!I think convenience methods like this are great, but making small little functions like this yourself can also be good exercises for beginner programmers.
This function was so convenient, I wrote an extension function in c# that works in any c# collection, as well as one for the weighted random.