Download

Instanced Timer ?

Is there any way to create an instanced timer ?

The exec chain is … Event Begin to a repeat calling an event that creates a component, and at the end of the event to call a timer to destroy the component just made.

Thing is when the repeat ends so does the timer. So I need to make the timer instanced and independent ?

Have you considered having each component set a creation time using ‘Get Game Time In Seconds’, setting a destruction time with the same node and a float+float, then using a ForEachLoop + Branch checking whether each component which has a timer should be destroyed?

If you could explain the gameplay mechanic this is for it may be easier to help.

I did use a separate branch before using a looped delay to destroy the component and this does work but then changed my mind. Instead of one event to create the component and separate timer to destroy I want to set a timer once the component is created to clear up after itself.

Isn’t there a Life Cycle you can set on the details, or is that not what you want to do?

d28e0f035e928827171d14a944ecf18bc8206698.png

An actor with this inside will vanish after whatever you set that variable to.

Like with an Actor, life time ?

Thanks mbelarouci but that’s for an Actor not a Component. I had considered that but wanted to keep things contained to the creation bp.

e31385a2c527adf8d7d6dddab7dd321c5cf3ad9f.png

Here you go.