How do I allow customization of controls?

Using action and axis mappings. I recall reading in some tutorial that using those allowed for easy customization of controls. This is obvious from the developer’s side, but how do I allow the player to customize them? I can’t find any function (neither in C++ nor Blueprint) that would allow me to change the binding of a named control during runtime.

i realized i can use a DataTable to convert between Key display names and integers, so here is another version of that key rebinding blueprint, which can bind any input, as long as it exists in the DataTable:

until blueprint gets Tmaps, or setting delegates by name, or integer keyIDs, this will work well enough for my needs.

Thanks for the extremely detailed blueprints. Question about the C++ though: doing BindKey just binds a new key to a specific delegate, does it not? The old key/action is still bound to the same thing. What I want is, say in the project properties I created an action mapping called “Jump” and set it to the E key. Now I have a customization screen and when the user chooses a new key for the ‘Jump’ control, I want “Jump” to be remapped to R or something–pressing E would no longer do anything. Calling BindAction or BindKey looks like a setup process–is there nothing like RebindAction("Jump", EKeys::R)? Not trying to change the delegate here, just want to set “Jump” to another key.

you can try GetNumActionBindings(), to find the size of the list.

then you can loop through by using GetActionBinding(ID).

then you can compare the returned object’s ActionName to the name you are trying to rebind.

if you find a match, you can use RemoveActionBinding(ID).

once you have removed all Actions with the same name, you can add your new action with AddActionBinding()

I haven’t tried any of this, but i think its usually better to let the player bind more than one key to the same action. having 1 action per key makes sense, but having 1 key per action shouldn’t be necessary.