How to transfer/keep PlayerMappableOptions when remapping

I think I’m missing something, but whenever unmapping a key and mapping a new one, nothing saves.
This makes sense since they’re different inputs, and different inputs can have different settings, but you can’t copy the settings over through the struct so I’m not sure how to go about this.

Thank you.

Acabo de probar lo mismo que usted tiene y me funciona bien, no creo que su Mapping Context sea nulo lo más probable sea el action que sea diferente al que está observando.

The results are still the same, even using the return value from map key and using a variable for the action to ensure it’s the same one.

It also shows in the context asset itself.
Before running the unmap-remap:


After the remapping:

If I remove the Unmap Key node, we can see the intermediate:

Player mappable options is also not transferred.

I’m thinking that it may be solved by using the add player mapped key and remove player mapped key nodes, but since the interface isn’t implemented, it doesn’t do anything.

Que versión de Unreal Engine tiene ? Yo tengo la 5.1 y la 4.27.2

This is in 5.1, but I have 5.03 and 4.27.2.

Aquí tienes una prueba en 5.1.

Si te funciona quiere decir que es una config en tu proyecto y si no funciona parece que es un problema de tu versión de UE.

hbiblia/Enhanced-input-system-remapping-5.1: Enhanced input system remapping (github.com)

I downloaded that project, but it doesn’t address my issue.
My problem isn’t that I can’t rebind a key, it’s that it doesn’t save the player mapping settings when I do so.
Your input mapping context doesn’t have player mappable enabled to start.

An edit after the fact- it seems that this process has been massively simplified in 5.3. I haven’t had the time to upgrade to 5.3 and get a comprehensive look, but it may now be as simple as it should’ve been.

So the solution to this involves quite a few steps, and doing anything wrong breaks everything, but I’ve finally figured it out.

One note → Absolutely Never use RemovePlayerMappedKey
It will break everything.



First, you have to get an array of all your contexts. As far as I know, there’s no way to use this method and save to the contexts. Though, this may be considered a positive since you don’t have to save defaults- these contexts will always have their default values, meaning don’t check them for current values (cause they won’t be).



Second, you have to apply all your mappings from those contexts, making sure to enable apply immediately. This should be done on begin play.


The GetAllPlayerMappableActionKeyMappings macro in this image is just made cause I use it so often, but what it does is gets all the mappings from every context, checking if they’re player mappable. This can be done with a built in function of the same name, but that only checks active contexts. It can be substituted for this:



I have my GetKeybind in a function library, but you can put it anywhere. This is how I’ve implemented it. This will work so long as you’ve done the previous steps prior to calling this.



This is the function I'm using to change keybinds. Pretty simple- just use the name you've assigned to the keybind and make sure to call save.




This part forward is for saving and loading

After pushing these changes in the first step, check whether there is a save for keybinds already. If yes, load.

The loading is straightforward, just make sure to use the player controller input subsystem:

And the loading is even simpler. I’m using the same macro as I used before, and I’m just adding the data to a map in the savegame. Saving is done whenever a keybind is changed.

3 Likes

Hello, in 5.3 it’s missing PlayerMappableOptions and IsPlayerMappable bool
Is there a workaround?

An edit after the fact- it seems that this process has been massively simplified in 5.3. I haven’t had the time to upgrade to 5.3 and get a comprehensive look, but it may now be as simple as it should’ve been.

There have been a few changes to that.

First off, in the input action you have to select the experimental option under player mappable key settings. This is warned to not be supported long term, so be careful.


You can then change settings:

PlayerMappableOptions are now called PlayerMappableKeySettings.
There isn’t an explicit IsPlayerMappable bool, but if the player mappable key settings are valid that means you’ve defined it to be player mappable.

2 Likes

this limits us to a single key if we can only use the IA to store the settings, I was hoping to find a way to access the override settings in the context but alas so far I haven’t figured out how to access this if I can figure this out I can finally finish


t