I need help with making a Dice

I’m really new to C# and I decided I wanted to make a Dice I’ve tried 3 Tutorials and none of them have worked can someone tell me how to make it so when you click on an Image (Or Button) in the Ui Layer it will change an Image to a number 1 - 6. I don’t care about animations just want it working.

Sorry I worded that wrong I want to change it to 1 of 6 images not an Imag to a number 1 - 6.

int dice = Random.Range(1,7);
1 Like

Could use what rarac said with a switch statement:

int dice = Random.Range(1,7);

switch(dice)
{

     case 1:
     {
          //swap image to 1
          break;
     }

     case 2:
     {
          //swap image to 2
          break;
     }
}