- Home /
Dynamic rebinding not working in new input system.
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();
}
Answer by dubbist · Feb 03 at 11:12 AM
I just watched the same video, and perhaps because you are referencing Movement Action instead of the Player Action Map, it's causing problems (according to the CodeMonkey code)
playerInputActions.Player.Jump.PerformInteractiveRebinding()
Your answer
Follow this Question
Related Questions
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
New Input system not having the properties of an actionmap 0 Answers
Input Help! 1 Answer
valve index A button mapped as grip 1 Answer
IOS object touch, collider 1 Answer