What is the correct syntax for a random function with decimal?
Hello,
as the title says, what is the correct syntax for a random function with decimal? If I put a spawn behavior in a timer with "random(0.5,2)" it spawns a lot of actor without respecting the timer. Any idea about this? I think that it doesn't recognize the "0.5"...
Thanks
as the title says, what is the correct syntax for a random function with decimal? If I put a spawn behavior in a timer with "random(0.5,2)" it spawns a lot of actor without respecting the timer. Any idea about this? I think that it doesn't recognize the "0.5"...
Thanks
Comments
Hi @patapple
As random in GSC can only deal with whole numbers, you have to add another rule to convert it to decimal.
So in your example, random(0.5,2) , if you wanted the decimal in tenths, first times by 10.
Change attribute YourAtt to random(5,20)
Change attribute YourAtt to YourAtt/10
Thanks