I’m using advanced mapping and I want to add a quick tutorial at the beginning of my game to go over the usual “press WASD” to move, “press E to interact” etc, but I want the key it tells you to press to be different if the user has changed the key mapping. Also I’d like to add a toggle in the settings for using controller vs keyboard and when switched I’d like it to give controller prompts instead, what way can I do this?
Promote the “Press E To Interact” text in the widget to a variable, and in the graph area for the widget do a set text node after a custom event. Drag the set text node pink inputs into the custom event so it can be set by other things. Then in whatever object you’re interacting with do a cast to WB_PressEToInteract or whatever your interact widget is called and from the object you can set the text to be anything.
(Top) Press E To Interact Widget:
(Bottom) Object You Want To Change the Text or interact with:
Sorry may be poor quality had to combine into one image because I’m not allowed to post 2 apparently. Also in my code I have it so the widget is invisible unless you look at the object so if you don’t have that functionality or don’t want that don’t do that node or set it to visible.
By the way you have to add the widget to the components within the object blueprint but you probably already have that if you have the widget showing you just want to change the text right?
What I want to do is, for example if the player rebinds the interact key from E to F, instead of showing “Press E to interact” it will now show “Press F to interact” in the prompt.
ahh okay my bad then use this same formula and then look into Enhanced Input Action Mapping with widgets.
A quick node I found was off of input action (blue): get all player mapped keys which has an input for mapping name and a return array value that could be cast to the widget blueprint.
if I were to add a bunch of images to my project, one for each key, would there be a way to pull a certain picture based on the result from the return array value? so it’s a bit more stylized like you see in games which use the image of a keyboard key as their input prompts?