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
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
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
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Thanks