Progress bar timer by holding down a key

No matter where I look it doesn’t seem like there’s a tutorial for it.

All I’m trying to have happen is a player needs to hold down a key on an object for a certain amount of time where there is a progress bar filling up representing how much they have left. And after doing this with X amount of objects, something happens.

And only have the progress bar show up when interacting with object

Not a tutorial but a stub of something you can potentially take further. It has 3 elements.

The pick up item:

An actor with a static mesh. You can create custom object types in Project SettingsObject Channels.


The widget:

It has a Progress Bar and a Custom Event that shows / hides it and plays an animation. The widget animation drives the progress bar from 0 to 1 over 2s.


The main logic is in the first person character.

It creates the widget. Traces for valid objects and counts how many have been collected - once 3 items have been collected, it shows a message.


The Trace for Pickups function visible above does two things. It check whether what we’re looking at is a valid object - one of the pickups. And it keeps the widget centred for the duration.

Image from Gyazo


It needs more work, functionality, utility, and some additional checks. Currently it does not care whether we’re picking up the same object 10 times. It does not cancel tracing when shifting focus from one object to another with no gap between them. It can all be ironed out, though.

Any questions, do ask away.

You could try this. It may be way more functionality than you need or it might be just right. Maybe a slight modification here or there for your purpose but this should give you most of what you want right out of the box.