Timer help

how do i set timer to spawn an actor at random times between 1 and 10 seconds

i tried the Random(min,max) replaced min with 1 and max with 10 doesn't seem to work?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited March 2013

    Hi @Adamgopro a limitation of the Timer Behaviour is that it can't be updated, in other words it'll just use the first value its given.

    A workaround is to set up a loop, to re-trigger the value as different every time.

    One way would be as follows:

    Rule: When SpawnCycle is false
    Change Attribute Random to Random(1,10)
    Timer: After Random seconds
    Spawn
    Change Attribute SpawnCycle to true

    -------

    Rule: When SpawnCycle is true
    Change Attribute SpawnCycle to false

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • AdamgoproAdamgopro Member Posts: 310
    @gyroscope thanks a lot mate!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited March 2013

    You're welcome! :-)

    PS One thing I didn't make clear (which you probably sussed anyway) is to make sure that the line: "Change Attribute SpawnCycle to true" is in the Timer behaviour along with the Spawn behaviour.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.