Random.Range not working

I am creating a game that uses a random variable in my start function, it works for all my green objects but all my red objects come out as zero. Anything I can do to fix it? Here is my code:

attackpow = Random.Range(min,max);


How Random.Range works differently depending on the data type of min and max. If they are float then max is inclusive. If they are int then max is exclusive.

Also look at:

it’s old but still valid. Hope this helps

Oh wait, I fixed it somehow! I converted my min and max floats to ints and back and then it worked again… Any idea why?