Change key binding Enhanced Input at runtime

How can you change key binding of a Enhanced Input at runtime in blueprints?

What I would like to do is to have a variable Controlls (of type Input Mapping Context) inside my User Settings variable of type Save Game that contains all the game settings and it is inside CustomGameInstance, and any changes to be applied to that variable and then applied to the controller.

I have a Input Mapping Context which contains all the Input Actions. I’m giving the user the option to have 2 keys for the same action (for all of them), so for example for moving forward I made two inputs MoveForward1 / MoveForward2. Maybe it is not the recommended way to do it, but I thought it might be easier for me this way. I can change it if there is a way easier/better, it is fine.

For now I’m using this inside the Character blueprint for testing so that the inputs can be used, on Event BeginPlay execution line:

But for input of Mapping Context I will change it to get the variable from inside CustomGameInstance after fully implementing it:

I postponed implementing a key binding menu for as long as I could but now I have to do this as well.

Here’s a tutorial on user mappable keybinds:

And here’s a tutorial on saving & loading the game:

I also found one that combines both:

Hope these help! :blush:

1 Like

Thank you! I found one quite similar to that, but I still watched them, just for the chance they used something not really related to the subject but still useful for me later on.

My main problems was that I didn’t knew about the existence of loop on mappings, after that things went a lot easier, and managed to make a complete widget for all keybindings.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.