I have a ‘set timer delegate’ node, set to looping. I have the time set to a ‘random float in range’ with a min and max time value. I want it so that every time the timer loops, it will randomize the time again. My problem is that on the initial execution of the timer, it will pick a random value, but each time it loops it will use the same value without randomizing again. How can I get it to randomize each time it executes a loop?
Instead of setting “Looping” to true, plug random number generation to “Time” input and at timer trigger call “set timer delegate” again, it will set timer over and overagain increasing a loop but with different “Time” every time. Don’t worry, set timer functions are async so you won’t infinitely loop the thread. Ofcorse then to stop this timer to loop you will need to break loop you made with nodes by condition check before each set timer call
thanks! i got it.
Thank you so very much :D.
Would be awesome if there was a change Timer Time node. BUT! this totaly worked for me too so ty tyty
I bumped into this same problem using a random start timer on AActor BeginPlay. I found this excellent tutorial blog explaining how this can work in C++.
Hi everyone, found another solution to this:
I set looping to true with a 1 second timer, get a reference to the timer handle, and then pause that timer handle after execution of whatever you’re trying to do. Once you pause the timer handle I set a delay node with a random float in range node (1-5 seconds, keeping in mind this really means 2-6 seconds because of the one second loop), and then unpause the timer to continue the loop. Hope this helps!