For Unity developers shipping a gacha banner, card pack or loot crate to the App Store or Google Play. Both stores require the odds of each item to be shown before purchase (Apple guideline 3.1.1, Google Play payments policy). Change the table and the numbers below recompute instantly.
name, rarity, weight (weights are relative)
0 in "hard pity" means no pity. Rows with weight 0 or less are left out of both the roll and the disclosure.
This is the table script from the package, unchanged. Copy it into Assets/; Unity 2021.3+ in Built-in, URP or HDRP. It computes the same numbers as this page inside Unity.
Open the free script page · DropTable.cs as a .unitypackage
This page is the working piece. The full pack has everything below.
Apple 3.1.1 and Google Play require loot box odds before purchase. 5 C# scripts, 12 inputs, 4 steps: one table rolls and discloses. Building it yourself: two days at the BLS 2025 median of $
BLS 2025: median software developer pay $64.44 per hour; two 8-hour days of writing and testing this system = $1,031.
Buy the full version — $10· ReadyStack
Real numbers from this tool, line by line.

Your gacha panel says Legendary 0.60%. With hard pity on pull 90, the rate a player actually experiences is 1.43%. Both numbers are true, and a player comparing them will ask which one you disclosed.
Apple's App Store Review Guideline 3.1.1: apps offering loot boxes or other mechanisms that provide randomized virtual items for purchase must disclose the odds of receiving each type of item to customers prior to purchase. Google Play's payments policy asks that the odds be disclosed clearly, in advance of, and in close and timely proximity to, that purchase. So the odds have to be on the purchase screen, and they have to be the odds your game really uses.
The usual setup is a weighted random function in one script and a list of percentages typed into a UI panel somewhere else. It is right on the day it is written. Then someone rebalances a weight and nobody updates the text. Rounding causes a smaller problem: three items of equal weight shown at two decimals are 33.33% each, and the panel adds up to 99.99%.
Pity makes it harder. With a Legendary base rate of 0.60% and a guarantee on pull 90, the average player needs 69.7 pulls, not 166.7. That is a consolidated rate of 1.43%. 58.5% of players reach pull 90 without a Legendary and get theirs from the guarantee. Move pity to pull 80 and the average falls to 63.7 pulls, 1.57%.
We compiled the five scripts in this pack against the Unity API surface they use and rolled the default table 2,000,000 times through the roller with pity on pull 90. The observed Legendary rate was 1.433%, against 1.43% from the formula, and the longest gap between Legendaries was exactly 90 pulls. A second request in the same frame returned nothing, a request for 50 pulls was capped at 10, and a stored pity count of 5000 was clamped to 90. The self-test script rolled 1,000,000 pulls and found every item within 0.05 points of its disclosed rate.
DropTable holds items, rarities and weights and computes each exact rate, the rounded rate, the displayed-sum check and the average pulls with pity. GachaRoller rolls that same table, with hard pity, a same-frame double-fire guard and a cap of 10 pulls per request. OddsDisclosurePanel writes rates, rarity totals, the pity rule, the consolidated rate and the player's own count into a UI Text on the purchase screen, and unsubscribes in OnDisable. PityCounterStore saves the count per banner and clamps edited values. OddsSelfTest rolls a million pulls in Play Mode, 20,000 per frame, so the Editor does not freeze.
Twelve values are exposed in the Inspector. It needs Unity 2021.3 or newer and has no materials or shaders, so it works in Built-in, URP and HDRP. It does not include a server or receipt validation.
The free calculator takes your own drop table and pity pull and gives every rate, rarity totals, the sum check, the average pulls and the consolidated rate, plus disclosure text to paste. DropTable.cs is free to copy. For scale: BLS 2025 puts the median software developer at $64.44 an hour, and two working days of building and testing this is $1,031.
It gives your Unity game one drop table that is used twice: to roll the item and to print the rates on the purchase screen, so shown and rolled odds cannot differ. You get 5 C# scripts, 12 inputs you set in the Inspector and 4 setup steps: hard pity, a saved pity counter per banner, and a 1,000,000-pull self-test that flags any drift.
Solo and small-team Unity developers shipping a mobile or PC game with paid random rewards: gacha banners, card packs, loot crates. You submit to the App Store or Google Play, where randomized items bought with money must show their odds before purchase, and you do not want to write and test the roll, pity and disclosure code yourself.
A chatbot writes a weighted random function in seconds. What it does not give you is the part that fails review or misleads players: rates printed from a separate hard-coded list, rounded rates adding up to 99.99%, pity that silently changes the real rate, a double tap that pulls twice. Each script here carries one of those guards, and the self-test proves the rolled rates match.
The web page is free and complete: paste your drop table, set the pity pull, and it shows every item rate, rarity totals, whether your rounded rates add up to 100%, the average pulls to the pity rarity and the consolidated rate, plus disclosure text you can copy. DropTable.cs is also free to copy. The paid package makes the game roll that table and show it in Unity.
The package is a one-time payment, not a subscription. The yardstick is your own time: BLS 2025 puts the median US software developer at $64.44 an hour, so two working days of writing, wiring and testing a roller, pity counter, disclosure panel and self-test is about $1,031. Check the free calculator with your own table first, then decide.
One question, answered by the person who built it. Your email only if you want the answer sent.