Need help unsetting keybinds? Keep confusing myself lol

I’ve been working on a settings menu for my game, one of the things I’ve been trying to add is a menu which would allow the player to rebind keys.

This all works as it should, however I’m trying to set it up in a way that if the player tries to bind a key that’s already taken, it will clear the other keybind.

For example “Roll” which is “C”
If the player were to keybind “C” to lets say “Jump”
I want it to clear the “C” for “Roll”

I kind of got it, but it don’t work as it should, wondering if somebody could take a look and point me in the right direction? I keep confusing myself haha!


^^^ This is my control screen widget, I’m using a for each loop to go through each keybind for a given category I’ve set, and then I add a key selector for each keybind to the vertical box, then I add them to an array.


^ This is the preconstruct for the key selector widget.

ks
I’m using the Key selected event to check if the selected key = the old key which is the variable set in the preconstruct.


^ this is the event that happens if the above branch = true


^ this is the event that happens when the above branch = false

It kind of works, when I’m setting new keybinds to the ones I’m selecting, with keybinds that are already taken up, And it will clear the already taken keybind like it should, But like I said it only does it for the first 2-3 and then It’ll start to get confused I guess?

fjgif

Engine version 5.1

I appear to have fixed it! Woops :stuck_out_tongue:

But if anybody knows of a better way to go about it I’m still all ears…

This Is how I Fixed It…

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