How do you make a scene timer rule that is repeatedly checked?

BacktothisBacktothis Member, PRO Posts: 75
I wanted to spawn something every say, 1 second. The problem is, I can't use the game timer (because that messes up the spawn timings if the game is ever paused), and I can't just add an attribute to check if the scene is paused (because then the spawn timing is messed up if the game ever hangs for a moment while on that scene for whatever reason).

So I tried using the scene timer.

nextSpawnTime := 0

When scene.Time >= nextSpawnTime
-->Change Attribute: nextSpawnTime = nextSpawnTime+1

What happens is that it nextSpawnTime is incremented to 1, but thereafter is never incremented again, so I guess the rule is only being triggered once, since Display Text shows that scene.Time grows past 1 quite quickly. How do I fix this?

Comments

  • BacktothisBacktothis Member, PRO Posts: 75
    Ok well I fixed it, although I don't know why. As long as nextSpawnTime is set to something other than 0 at the beginning, it works. But if it's set to 0 it will only trigger the rule once.
Sign In or Register to comment.