How to loop/repeat function?

Hello. I ran into a problem where I need to update a number every 60 seconds, but it only works once. Is there a way to make it soo that it would loop/repeat when the function reaches at the end or when 60 seconds are over.

The function I am trying to loop/repeat

A timer?

image

Once started, it would fire the event every 60s just like that.

4 Likes

It sounds like you want to run a function that updates a number every 60 seconds, and you want this process to repeat indefinitely. To achieve this, you can use a loop along with a delay function. Since you haven’t specified a programming language, I’ll provide a general pseudocode example that you can adapt to your specific language:

while true:  // Infinite loop
    // Call your function to update the number
    updateNumber()

    // Pause the loop for 60 seconds
    sleep(60 seconds)

My guess it’s Blueprint Scripting… :innocent:

Either in tick or construct, I don’t know which is the best way. It’s been a while since I wrote a widget BP. I know best practice is to stick far away from tick, unless you have to. You should be able to call a function to trigger the event. Search the bp database, non-contextual, for your “Timer”. There should be a function in there for the event.

Double like!