It appears as if widgets can’t clear timers in UObjects. If I have a keyboard input that clears the timer, it clears. If I have a widget button that calls a function that clears the timer, it’s not clearing. If I try to clear the timer directly from the widget, it’s not clearing.
Third person template. Show mouse.
Create a blueprint, type Object. Add a function called ‘loopf’, which prints string “hello”.
Create a widget with a button. When pressed, it calls ‘CustomEvent_1’ in the character.
Create the following setup inside the character:
Expectation: pressing either “2” or the widget button should clear the timer.
Result: pressing “2” clears the timer, but not pressing the widget button.
Doing the same thing, but with a function inside the character does clear the timer by pressing the widget button.
Any suggested work around? The looping timer must be inside an Uobject.
I was able to reproduce this issue on our end. I have written up a report and I have submitted it to the developers for further consideration. I have also provided a link to the public tracker. Please feel free to use the link provided for future updates. I was able to find a workaround that may be viable depending on your needs.
Link: Unreal Engine Issues and Bug Tracker (UE-39629)
I used tick in combination with a gate that I could open when calling a custom event. This means that the event calling the clear timer node will be from the blueprint that it is in, allowing you indirect communication. In the workaround provided below, I have set it up so that it will only call the Clear Timer By Function Name once and then reset itself so that it can be called again if needed. I hope that this information helps.
Make it a great day
I don’t know if this is helpful or important in any way, but it is the same problem with starting timers from widgets.