Works in Unreal Engine 5.1 to 5.8 (Enhanced Input). Updated November 2026.
Quick answer: use the Hold trigger and its Ongoing event.
- Open your Input Action (for example
IA_Interact). Under Triggers, click +, choose Hold, set Hold Time Threshold to2and tick Is One Shot. - In your character, add the EnhancedInputAction IA_Interact event.
- Started: show the progress bar. Ongoing: Set Percent to Elapsed Seconds ÷ 2. Triggered: drink, eat or open, then hide the bar. Canceled: hide the bar.
Why nothing happens while you hold
With a Hold trigger, Triggered fires only once the key has been held for the full Hold Time Threshold. Code on Triggered can’t run “during” the hold. The events you get:
| Event | When it fires | Use it to |
|---|---|---|
| Started | The frame you press the key | Show the bar, start an animation |
| Ongoing | Every frame while held, before the threshold | Fill the bar |
| Triggered | When the threshold is reached | Do the action |
| Canceled | You let go too early | Hide and reset the bar |
Method 1: Hold trigger (recommended)
Step 1: Set up the input
- Open
IA_Interact. In Triggers, add Hold. - Set Hold Time Threshold (seconds) and tick Is One Shot, so it fires once, not every frame after the threshold.
You can also add triggers on the key inside the Input Mapping Context. Put them in one place so you don’t stack two.
Step 2: Add the progress bar
- In your HUD Widget Blueprint, add a Progress Bar named
HoldBar, tick Is Variable, and set its Visibility to Hidden. - In the character’s Event BeginPlay, Create Widget for the HUD, Add to Viewport, and promote the return value to a variable.
To show the bar over the object instead, use a Widget Component.
Step 3: Wire the events
- On the EnhancedInputAction IA_Interact node, click the small arrow at the bottom to show Elapsed Seconds.
- Started: check you’re near something usable (see below), then Set Visibility on
HoldBarto Visible. - Ongoing: Set Percent on
HoldBarwith Elapsed Seconds divided by your hold time. Percent runs from 0 to 1. - Triggered: run the action, then hide the bar.
- Canceled: Set Percent to 0 and hide the bar.
Store the hold time in a float variable so the division and the trigger setting match.
Method 2: Pressed and released with a timer
Use this if you want the timing in your Blueprint, or the same input does other things.
- Leave
IA_Interactwith no triggers. Started fires on press and Completed on release. - Started: Set Timer by Event with Time = your hold time and Looping off. Promote Return Value to
HoldTimer. Connect the red Event pin to a custom eventFinishInteractthat does the action and hides the bar. - Triggered fires every frame while held: Set Percent with Get Timer Elapsed Time by Handle (
HoldTimer) ÷ hold time. - Completed: Clear and Invalidate Timer by Handle (
HoldTimer), then reset and hide the bar.
Only interact when something is in range
Give the usable object (or a water volume at a lake edge) a collision box. In its On Component Begin Overlap, cast Other Actor to your character and set the character’s CurrentInteractable variable to Self. Clear it in On Component End Overlap. Then put an Is Valid check on CurrentInteractable before you show the bar and before you run the action.
FAQ
How do I drink a sip every half second while holding?
Use a Pulse trigger with Interval set to 0.5. Triggered then fires every 0.5 seconds while the key is held.
My Hold event never fires at all.
Check that the Input Mapping Context with this action is added to the player, and that the event uses the same Input Action asset you edited.
Can I play an animation while holding?
Yes. Start a montage on Started and stop it on Canceled, so it ends if the player lets go early.