How to control a random 3/4 Ratio?
Hey, I am having trouble in figuring this code out. In my game, you make a bet and choose one of the four boxes. You either get a reward or trap. my problem is !! I am trying to figure out how to make the reward to trap to be 3/4 or 1/4 or 2/3 ratio in a random section. So the player can choose the difficulty they want. Does anyone have any suggestion? I will show you the code I have done so far from the tutorial I have to learn from. An extra note, I am pretty new to coding.[1]
[1]: /storage/temp/148930-screenshot-2019-11-19-at-152109.png
Old question, but you need to explain your question better and post the actual code.
To get a random event with a chance of 1/3, you need
if (Random.Range(0, 3) == 0)
Thank you, @ceandros. I was going for what I have in the image. I decided to add 4 prefabs, and random the sprites.
So you managed to do what you wanted?
Your answer
![](https://koobas.hobune.stream/wayback/20220612215014im_/https://answers.unity.com/themes/thub/images/avi.jpg)