How do I use FWeightedRandomSampler?

Trying to add a random loot spawning aspect to my game and got tips to make it a weighted system since I want there to be different percentages. Right now I just have a potion and a chest to spawn but will add more stuff once I have figured this out. The potion will be 75% chance, and the chest will be 25%.

I saw that there is a header file called FWeightedRandomSampler, but couldn’t find any documentation on how to use it, nor any videos or posts about it. Could anyone explain to me how this works?

Thank you!

Hi uipko,

You can use the FRandomStream and the Kismet library to do that, check out: