Timer problem, first time it counts to 10, 2nd time only to 9, why?
I have a spawner that has the following code:
If 'spawn' = false...
For 10 seconds...
Every 1 second, spawn Monster
after the first loop through (10 spawned and 10 monsters killed), it resets Spawn to false, only this time it only produces 9 monsters, why would it do that?
I played with the 'run to completion' but it didn't change anything
If 'spawn' = false...
For 10 seconds...
Every 1 second, spawn Monster
after the first loop through (10 spawned and 10 monsters killed), it resets Spawn to false, only this time it only produces 9 monsters, why would it do that?
I played with the 'run to completion' but it didn't change anything
Best Answer
-
tatiang Posts: 11,949
If you do the following:
Timer For 10 seconds --> Timer Every 1 second --> Log Debugging Statement "spawn"
and then look at the Debugger window, you'll see that only 9 statements are logged.
For reasons I don't understand, you'll need to add a bit of buffer to the For timer behavior. Usually, it works fine if I do Timer For 10.1 seconds --> Timer Every 1 second --> SpawnNew to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User