Yatzy dice game: "Random" never returns 5 of a kind

Help for a raw C# beginner whose last programming was Fortran and Basic in the eighties? Declared float as required and assigned die1 = Random.Range(1, 7); dice 2-5 similarly. Using Debug.Log, every dice roll in looping is correctly changing all the 5 dice numbers from 1-6, except that there is never a 5 of a kind result. When I manually assign the same number to all 5 dice and bypass Random, the program works correctly and indicates Yatzy. I read that the random number generator is not perfect, so I suspect Random is the problem. This will be the end of this difficult (for me) project if I can’t get around this problem. Thanks in advance for any tips. PS This is my first post; I will try not to waste anyone’s time with lazy questions.

You probably don’t want to declare die1… etc as float. You’d be better off casting or converting the random result to an int… like so

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