How to create random button prompts

Hey im a games design student still learning code and blueprinting i know what i want to do but i dont know how to translate it into blueprint, similar to the Telltale Walking dead series how it has a button prompt on screen when in ‘combat’ that if you dont press in time the walkers or other characters hit you i want to create a triggerbox area in which that similar button prompt would show up on screen as a form of a reaction speed test so multiple random button prompts that the player would need to press within 1-2 seconds of them showing up on screen before going to the next one. Any help is appreciated

You need punctuation, desperately; almost run out of breath reading that run-on sentence :wink:

What you’re asking for is somewhat involved, I’ll just outline what’s needed briefly.

For the widget:

  • create a widget with the prompt - a text box showing which button to press will do
  • override onKeyDown and check what button is being pressed
  • make a list with the correct key sequence, an array perhaps or a Map
  • once the correct key has been pressed, step to the next element in the array
  • once the last key in the sequence has been correctly activated, have the widget send a notification to whatever needs to act next
  • if any of the sequence steps fails, have the widget communicate that as well
  • switch back to Game and UI mode (see below)
  • remove the widget from the parent, destroying it

For the trigger:

  • onBeginOverlap create the widget
  • add it to the screen and set position in the viewport
  • switch to UI only and set the focus to the widget created above (this way the player cannot do anything else but mash buttons)

Sorry for such a late reply, i’ve been under the weather and only just got round to trying this out the last couple days. But im struggling with following on, if i create the text box and have the text of it say e.g “Press E”, even if i want to change which button needs to be pressed the text wont change? So im confused as to the order of how to go about it. As well as being a newbie to unreal, i recognise the terms you are using such as ovveride onKeyDown and array and map but im not entirely sure on how to create them if its not too much to ask and if you dont mind of course could maybe provide screenshots to help me understand better.( i understand more visually than i do from following a set list of instructions) Thank you.

The thing is that you’re asking for help with creating an entire system from scratch. It would take time to crate it, time to clean it up, and extra time to prep, comment and post it here. And there’d be many more follow-up questions after that, I’m quite sure.

Consider breaking it into small pieces to ensure you’re familiar with the basics first, and only then glue the pieces together.

Start with widgets, see if you can create a widget and bring it to the screen. Then work on having it intercept a key, then look into arrays… and so on.

If you have a more specific question, do tell.