How do I use several timers? (GDevApp)

When I try to use timers to create objects in GDevApp, I cannot use two different timers twice in the same game.

Say for example:

Condition: Timer called timer1 is greater than 0.5 seconds
Action: create object1 at position 100;100
Action:reset the timer timer1

Condition: Timer called timer2 is greater than 1 seconds
Action: create object2 at position 200;200
Action:reset the timer timer2

Only the first condition is able to create objects not the second one. Why does this happen?

I’m trying it right now and works fine:


Maybe the second event creates the objects but they are occluded by another object with a higher Z?, or a misspelling in the timers name? :confused:

Oh thanks. I realized that the timers need to be quoted to work. Is that the case?

Yes, you need quotes because timer names are strings, dynamic strings actually, you could use this string to access a timer:

"timer"+ToString(Variable(timer_id))

if the variable “timer_id” is = 2, GDA will look for a timer called “timer2” :slight_smile:
You can’t see it’s a dynamic string in GDevApp, but if you launch GD, you’ll see the string expression button next to the timer’s name parameter :wink:

1 Like