trying to use while that have 2 random range inside to get a any possible numbers that it will create a num

float num1=0, num2=0;
for(int i=0; i<=1; i++)
num1 = Random.Range(0, 9.6f);
num2 = Random.Range(0, 9.6f);
while (num1 + num2 != 9.6)
num1 = Random.Range(0f, 9.6f);
num2 = Random.Range(0f, 9.6f);
sorry if this is a noob question i just started making games(2D)

I highly recommend changing this.

From your code, I’m guessing you want two numbers, and for both of them to equal 9.6f?
If that’s the case, you should try doing something a little less verbose like:

float num1 = Random.Range (0f, 9.6f);
float num2 = 9.6f - num1;

which will achieve the exact same thing, but with possibly a thousand less operations.