Need object timer to go off at different times

This seems stupid,
But I cannot get an object timer to work at all.

I have an object timer that is assigned to each instance of an object. I want each objects timer to work independently when each instance randomly spawns in at random locations.

The timer needs to be started with a condition, but “at the beginning of scene” doesn’t work, as these objects spawn in periodically.
Every other condition I’ve tried doesn’t work other than “spawner just spawned object” but that once again affect all instance timers and not just the one that spawned in.

If I could somehow select the object that just spawned in as apart of the condition that would be a way to solve this, but I don’t know if that’s possible.

With “repeat for each instance” selected, I’ve tried only restarting the timer on the object with the highest Z order, thinking that the newly spawned in object will have the highest Z order out of all of them, but this also just affects every objects timer once the condition is met.
It doesn’t work as either a condition or an action.

I need the timer to start when each individual the instance spawns into the seen, and not affect the other instances timers

(I tried it as both a condition and action seperatey)

You could skip the spawn behavior and use a scene timer. Then when you add the object it would still be picked.

You could modify the spawn behavior.

You could check a variable or any object setting. If it’s the default value then change it to something else and start the timer.

I like state variables. IsNew is true by default.

1 Like

I’m unsure how to swap an object timer with a scene timer in this scenario

I tried tinkering around with variations of what you’ve shown here but it didn’t work, the timer wouldn’t work

I think I’m a bit confused on exactly how to use a variable to get the result I wanted :sweat_smile:

In the 2nd event in your screenshot, it’s using pick the highest z-order but it’s within a for each object. Since only 1 object is only picked at a time with a for each object, each object will always be the highest z-order.

Your method might work without the 2nd for each object. Try using the events without the for each object. That way, it would have all of the instances to choose from.

Alternatively, you could try my example without putting it inside a for each object. You could use a boolean variable or an object variable.

When a new object is added, the variable or object property will have the default value. So, it will be picked. You can then start its timer and change change either the variable or some other property. So, on the next frame it won’t be picked again.

My scene timer comment was for the spawning. Instead of the spawn behavior. When objects are added, they’re automatically the only object that is picked.

At the beginning
Start spawnTimer

spawnTimer > spawnTime
—Add object
—Start timer
—Restart spawnTimer