How would I show the value of a random value?

I’m stuck on how I would display (make a text object and give it the value of) the random.range number in my IEnumerator? Here’s my code: IEnumerator DigItBike() { if (canDiveBike == true) { - Pastebin.com

For example, I want, if I pull a “Bell”, an indicator of the number of points I got for it, to pop up (5-10(10 exclusive)). How would I go about doing this for all of the items?

Thanks.

You have to convert your float/int value to a string and then assign the string to a text variable. I will give you an example here. You can work around on your script with the help of this example, I believe.

public Text displayRandomRange;   //Make sure to add a Text UI component in your scene.
private string convertedRandyFloat;

void somefunction(){

float randy = Random.Range(2.5f, 31.5f);
convertedRandyFloat = randy.ToString();

displayRandomRange.text = convertedRandyFloat;

}

If you want to display the random value in each loop, create separate local variables of string.

Hope this helps !