I was thinking to do something like in the following blueprint for the part where the user can change the keybindings for directional movement, but the problem that I have is that they keys aren’t changing. By doing it this way it is easier for me when it comes to the UI where the user sees the keybindings, because I know that on position 0 is forward and on 1 is backward. I’m new to Unreal Engine and I tried to apply my knowledge from Java working with arrays. Are we unable to do it like this, or am I missing something?
P.S. I’m actually using UE5 but it is not added in the list yet, maybe because it is in “Early Access”, but this part it should have the same logic behind.
Blueprint containing movement forward and backward only, but left/right would be the same, only changing the name:
I was looking up my key mapping code, which doesn’t use an array ( probably irrelevant ). But while I was doing that, I have a vague memory, that the ‘get input settings’ node has to be used every time you want to call it. You can’t have more than one link coming off it.
That isn’t the problem because here I have 3 links from it, one to get action, one for remove and one for add, and it is working just fine. “Get Input Settings” is just an object reference, it can be used as many times you need to. I’m planning to modify this blueprint too, but for now it is fine as it is.
Because the order is not always the same after you call “Save Key Mappings”, sometimes it was setting -1 value first, and then 1, or vice versa, I ended up separating them in project settings by adding forward, backward, left, right as separate inputs. If you are doing this, don’t forget to change the settings in your character blueprint too.