FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.


descriptionNeed help with perncentage


I've been trying a long time to program a code which gives probabilities my Wheel of Fortune. The wheel of fortune has six fields, and each field is to get a chance in percent.

I have so far:

Number between 1-10 = 10% probability
Number between 11-40 = 30% probability
Number between 41-100 = 60% probability

[Random.Range(int min,int max)]

But i dont know how to use it.... Can someone help me?


descriptionRe: Need help with perncentage

Hello this is a small example


using UnityEngine;
using System.Collections;

public class Random : MonoBehaviour {

 public  int R1Min =1;
 public  int R1Max = 100;
 private int number;

    void OnGUI()
        if (Input.GetKeyDown(KeyCode.G))
            number = Random.Range(R1Min, R1Max);

        GUI.Label(new Rect(10, 10, 220, 220), "The number that was generated: " + number);

descriptionRe: Need help with perncentage

Thank you very much Smile, but is that working for the field of the wheel of fortune how i decribed it?
Permissions in this forum:
You cannot reply to topics in this forum