So I’m just starting to use and experiment with unity’s new input system and was checking out a tutorial by the CodeMonkey on dynamic button rebinding. I’ve hooked up my dynamic rebinding function to a button. i also log out the overriden key to confirm and that shows the new rebound key, yet the character in my demo scene still only responds to the old control. This is my code:
public void ChangeJumpButton()
{
Debug.Log("Start rebind");
inputActionsClass.Movement.Disable();
inputActionsClass.Movement.Jump.PerformInteractiveRebinding(0)
.WithControlsExcluding("Mouse")
//.OnMatchWaitForAnother(0.2f)
.OnComplete(callback => {
Debug.Log("Rebind complete");
Debug.Log("New key is " + callback.action.bindings[0].overridePath);
Debug.Log("Previous key is " + inputActionsClass.Movement.Jump.bindings[0].path);
Debug.Log("Previous key override is " + inputActionsClass.Movement.Jump.bindings[0].overridePath);
inputActionsClass.Movement.Enable();
currentJumpKey.text = inputActionsClass.Movement.Jump.GetBindingDisplayString(0);
callback.Dispose();
}).Start();
}