Download

UMG button increasing value while pressed

Hi

Just wondering what would be the best way to make a button that increases certain value over time while pressed, as Timeline and Delay are not allowed in functions, and functions are used to detect UI events?

It also seems to refuse to add a Timeline in the Event Graph for the binding that I have created.

Hello,
If on click you set a bool “released” false and use as condition in a branch : On false do a loop delay 0.1 : do your function which add 1 in hud. And on release you set your bool true. It would be ok.

Maybe you can create a timeline in your HUD blueprint (not the UMG widget blueprint, but the HUD default class that you are using) and create an event track that feeds custom events to your widget blueprint. From the general HUD you can stop and play the timeline at will.

thx for the tips guys :slight_smile:

Just check the IsPressed status of the button in the Tick of your widget blueprint.

You read my mind. Stop doing that,it’s creepy :3

In case anyone will wonder in the future how to do it, the IsPressed method works like a charm.

Thanks for your help guys.