Skip to main content

UI Input Request

A quick and simplified explanation of input prompts in the UI.

Overall, the mechanics that display the requested key in the graphical interface, also known as Prompts, serve only as examples here. I recommend implementing your own solution with plugins like CommonUI to achieve a unified, professional system that manages inputs across various types of controllers and for console functionality.

However, what’s important to remember from this example is that I do not tightly couple the UI with the Controllers or Pawns. I listen for events in the UI to determine what actions to take. In this case, I listen to the InputListenerComponent, which contains the event I named OnActionRequestChange.

Diagram

In the WBP_SFR_MainWidget, you can see that when the Leader Pawn is ready, we listen for the ActionRequest from its InputListenerComponent to know when it requests an input action.

Diagram

So when it receives the event, we update the UI input button state like this:

Diagram

An example of an action request call when the Fly Bird Character is in Glide mode inside the BP_DU_SFR_FlyBirdInputListener :

Diagram