Hold button with progress bar in widget UE5

Hi,

Is there a widget button on held event? I’m trying to press and hold a button on my widget with RMB that increments the progress bar over time. I’ve seen a couple of work arounds for this but they only seem to work on UE4

Why would you need a workaround in the first place? None was needed in UE4 and UMG did not change. The standard onMouseDown/Up no longer works in UE5 widgets?

Hi sorry I mean I’ve seen people use OnPressed and OnRelease with a timer that essentially makes the OnPressed event a held event. I tried the same thing in UE5 but the OnPressed only accounts for a single click. Is the on mouse down option selectable from the widget?

You run a timer or tick, or animation.

  • onMouseDown/Up:

  • timer:

The root of the widget is flagged as:

So it stays in focus throughout the entire click operation.


If you need many of those clickable bars, create user widgets with the above functionality and use them in place of the native progress bars. Skip the Canvas Panel in that instance.

3 Likes

yes that’s exactly what I was looking for, thankyou.
I copied your graph exactly and then added a bit of logic but for some reason I can’t seem to get this print string to fire. The Max percent is a Float of 1.0 correct?

Yeah, but comparing floats is a bit gimmicky. Try:

image

Is it safe to assume that the bar clicking works? Apart from the print string missing?

1 Like

Yes everthing is set up and firing correctly, the greater than fixed the issue, it now works fully

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.