To restate the question in a more thorough manner, my goal is to be able to run multiple SetTimerbyFunctionName’s at the same time, but with different delays, so that multiple instances of the same function are “queued” up.
My experience with this thus far is that it’s not possible because calling SetTimerbyFunctionName on the same function appears to result in the newest call overwriting the previous one. I understand that there is a Struct called a TimerHandle that can be used to reference the Timer that is returned when it’s set but I don’t know if there is way to avoid implicitly referencing it, as it appears to be doing.
Additionally, I’ve run up against a problem where these functions won’t know which Struct to use for their particular call because parameters can’t be passed into the TimerFunction calls. I thought to get around this by storing the next Struct of Data into a variable that the TimedFunction would check, but I’ve realized while typing this post that the value is just being quickly overwritten before the TimedFunction has had time to figure.
This leads me even further to the belief that this is an improper use-case for SetTimerbyFunctionNames and I might be better off setting up a method that manually counts time/frames itself but I figure it still worth checking here to see if I’m misusing the node or if there is a different one that is a better for my use-case.
Below is a screen snippet of how I have the nodes configured. For a fuller context of what I’m trying to do with this code, I am storing an array of Hitbox data into Structs. This array is then iterated through, setting the Hitbox Data as it’s own variable and the function responsible for drawing each of these Hitboxes is called with a timer:
TLDR:
I want to loop through an array, calling a SetTimerbyFunctionName on each of its elements but am facing two problems.
- The timer seems to reset with each call, effectively overwriting the previous call.
- If I’m not able to pass parameters into the Timed Function call, how can I make each of the Function Calls know which element they are meant to operate on.
Is there a way to resolve these problems with SetTimerbyFunctionName?
Is there a different node or set of nodes for this use-case?
Would I be better off coming up with a custom approach to tracking time and kicking off delayed function calls that way?