- Home /
Rebinding in New Input System
Hi, What could be the best way to change the path for each Action in the new input system? That's the only way I can think of to rebind controls...
I think the provided Unity example only changes the UI of the asset?
There's an entry in the How do I part of the docs on it, I came across it the other day but I haven't tried it yet
Answer by Erdal42 · Apr 24, 2020 at 07:30 AM
No, the provided example change do effectively the action, but by overriding it. If you actually try pressing the rebinded input you'll see. If you want to get programatically the real used path after the override: myInputAction.effectivePath
Answer by celinedrules · Oct 12, 2020 at 12:53 AM
It took me a couple of hours and tried countless examples but couldn't figure it out. Then I did and for me it was as simple as this.
[SerializeField] private InputActionMap player;
private InputAction action;
public void ChangeBinding()
{
action = player["Movement"];
if (action.bindings[0].isComposite)
action.ChangeBindingWithPath("<Keyboard>/w").WithPath("<Keyboard>/g");
}