How to use random timer?

Hello, i need a random timer in my game but it doesn’t work . Help please

A few pointers:

  1. You haven’t started the timer anywhere. Timers do not get created and started automatically. You need an event (like “At the beginning of the scene”), to start the timer.
  2. You are checking for the value of a scene timer, but never reset it (you’re resetting an object timer) and will remain greater than 0.5 seconds. This means the Meat object will be created every frame (approx 60 times per second).

As Mr.Men says, you’re using a scene timer as the condition and an object timer as the action. Be careful of this if it’s not the indicated action, because you won’t be resetting the scene timer.
On the other hand, the timers are activated from the beginning without the need to give the action to start them (you include the action to start the timer when it is necessary for it to start counting the time you want from 0, otherwise it will start counting the timer when starting the scene).
Finally, from my experience I can say that timers do not respond to “RandomInRange”, it will always take the lowest value of the selected range to execute the event. What I suggest is that you include a scene variable (or object if that’s convenient for you) and the random value is from the variable.
This is an example:

Do not do this:

1 Like

This has saved me! Thank you so much. It takes a while to get used to the use of scene or object variables. But I’m slowly getting the hang of it. You really can do quite a lot with this game engine.

1 Like