Hello! I want to make an interactive rebinding system in game settings but I’m not really understand how to implement check on buttons that already in use in other bindings/actions. As far as I couldn’t find ready-to-use solution in Input System documentation the only way I came to is create dictionary with all used paths as key and corresponding binding as value. So when player performs a rebind this system will check dictionary on containing of path player just have bond and if there is it will be removed from previous binding. Although all existing bindings are read-only I need to keep all path clear and do overriding path on game start. So I can just remove overrides and make binding empty if it’s path will be reused. Not very smart system but I can’t figure out any better solution.
It looks like the Input system supports rebinding: How do I…? | Input System | 1.0.2
As for your particular problem, might I suggest scriptable objects? You can store the original binding and current binding in them. (which saves between state changes/ closing & opening the game) It’s a much smarter system than dictionaries. (not that dictionaries are inherently wrong)
You can also use whatever you please to control these bindings and manage them.
Hope this suggestion helps!
Check this thread and particularly my post in the subject here .
Alternatively you can use the FindControls method and filter the results (check if they are in the same ActionMap and whatnot).
So basically this is very similar to what I’ve mentioned in original post just complementing with fact there is list of all available bindings in specific Action Map so I don’t need to build additional dictionaries. The only thing is still very complicated for me to implement is how visually remove old binding from different GameObject that contains image of that binding.