One-time items/collectibles from breakable objects - How to best implement

You could put the object names in an array similar to this example. You pick a random number based on the number of items in the array, create an object from that element and then remove it from the array.

Now, in your case you could add the randomly picked object’s name to another array and then every say 5 minutes remove an element form that array using the same technique and then add it back to the main list.

Another approach might be to add some bias to the picking of objects. Maybe have 3 groups; common, medium and rare. You could then pick a random number from say 1 to 100. If the number is from 1 to 70 then pick a random common item. If it’s 71 to 90 pick a meduim item. If it’s between 91 to 100 choose a rare item.

1 Like