Generate random float number
by andrisalim · in General Discussion · 06/15/2011 (11:39 pm) · 1 replies
Hi guys, how do you actually generate a random float value?
I saw there is getRandom(a,b); function where a and b are int and the returned value is float. Do I need to convert the returned to float by myself? Because I have gotten no float number from the returned value...
I saw there is getRandom(a,b); function where a and b are int and the returned value is float. Do I need to convert the returned to float by myself? Because I have gotten no float number from the returned value...
About the author
Torque is new and interesting to me. I am keen in learning and sharpening my knowledge of Torque, especially Torque 3D which I am currently working with. :) Cheers, Andri Salim
Torque Owner NCGames
Anyway, getRandom(%a, %b) returns an integer between %a and %b inclusive. getRandom() returns a float from 0.0 to 1.0.