(Setting timer → Delegate event gets called → Some logic → Timer gets "cleared and invalidated)
But once the “Set Timer by Event” gets triggered again (in our case when going back to the level selection from “ingame”) the code reaches the node but the delegate event doesn’t get fired at all
I hope somebody can give a hint in the right direction because I am already clueless at what the issue here is.
Am I not allowed to bind a delegate to the timer a second time? Do I need to clear it somehow beforehand?
Another thing worth noting: when I set a breakpoint at the “Set Timer by Event” node and reach it, on inspecting the timer handle trying to check what is bound, the engine crashes on me. I already tried it on different “Set Timer by Event” nodes but the issue remains on all of them.
Thanks for the suggestion, I don’t know if that makes any difference but I will try using a function instead, maybe the timer/delegate will get cleared properly then?
Apparently putting the logic inside a function didn’t solve my issue.
On the first run everything works fine but after calling “Set Timer by Function Name” a second time (timer was cleared before succesfully) the delegate function doesn’t get called at all
Also the engine crash makes me especially suspicious as I am not able to inspect the timer
Edit: It is also worth mentioning this logic resides inside the game mode, if that makes any difference?
Edit 2: After hours and hours of debugging I figured out that the problem was indeed the human in front of the computer. The game was still paused when activating the timer and event logic, which is why the timer didn’t run.
Learning: Always check your pause logic before anything else?