Search Unity

Bug 1.4.1 returns axis when rebinding instead of button

Discussion in 'Input System' started by Hertzole, Jul 31, 2022.

  1. Hertzole

    Hertzole

    Joined:
    Jul 27, 2013
    Posts:
    422
    I've discovered a regression with the latest version of the input system where it returns the whole axis instead of the button/direction when rebinding using a gamepad.
    In 1.3.0, pushing any stick to the left would give me <Gamepad>/leftStick/left but now it instead returns <Gamepad>/leftStick/x. This makes it incredibly hard to set up precise rebinds.

    I've submitted a bug report about this, IN-11956. In the meantime, my only choice is to stick with the 1.3.0 and cherry-pick some fixes myself because a large chunk of my rebind system does not work with 1.4.1.

    If this by any chance is by design, what would be the proper way to get the old better behavior back?
     
  2. andrew_oc

    andrew_oc

    Unity Technologies

    Joined:
    Apr 16, 2021
    Posts:
    77
    You can specify in your rebinding operation that it should only consider buttons, and then <Gamepad>/leftStick/left/right/up/down should come through and leftStick/x and leftStick/y will be ignored. Add the following call to your rebind operation:
    Code (CSharp):
    1. .WithExpectedControlType<ButtonControl>()
    .
     
    romi-fauzi and Hertzole like this.
  3. romi-fauzi

    romi-fauzi

    Joined:
    Aug 16, 2013
    Posts:
    161
    Boy am I glad to came across this threads, after frustrated trying to solve similar issue on my end, I do really hope this is documented much more clearly in the documentation.