How can I make something have a random delay every time?
![ascom](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
I have noticed that the random expression doesn't generate a random number every time. It seems to fill out all of the random expressions and doesn't regenerate a random number, even when it is called again. For example, this...
http://goo.gl/B6UGt
Changes the variable rand to the same value every time.
Could someone help? Or is it not possible?
http://goo.gl/B6UGt
Changes the variable rand to the same value every time.
Could someone help? Or is it not possible?
Best Answers
-
gyroscope I am here.Posts: 6,598
@ascom
It is possible to have a repeated random delay (assuming you mean repeated on a loop); here's a way I'd do it:
Make your integer attribute, let's call it RepRand. Make a boolean and call it Toggle.
Rule When Toggle is false
Change attribute Toggle to true
Change attribute RepRand to random(1,10) ---- or whatever your numbers are
Timer: (run to completion unchecked) After RepRand seconds
Change attribute Toggle to false
and to interrupt it with a touch:
Rule: When touch is pressed and Toggle = true
Change attribute Toggle to false
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers