How Do I make a gacha mechanic

Im trying to make a gacha mechanic I have 5 Png 1 R 3 SR’s and 2 SSR’s
How do I make it so when I click on summon I have a 40 percent chance at a rare, a 40 percent change for a SR and a 20 Percent chance for an SSR?

There’s probably a maths expression that i’m unaware of that one of the more experienced users will post below but i would set a number variable to ‘random in range’[ (1,100) and then check is its less than 41 or 21 etc

As mentioned, you can store a random number and then check if it’s in a range. In your case a number between 0 and 9 would work.

Here’s my test events. I used a button and text object. I used a for each child and an array just for testing. After a few thousand repetitions the numbers leveled out.

The results

1 Like