Search Unity

Question Why am I getting different behaviour in the Build?

Discussion in 'Input System' started by Simon-O, Nov 23, 2022.

  1. Simon-O

    Simon-O

    Joined:
    Jan 22, 2014
    Posts:
    51
    I'm trying to map WASD + Gamepad left stick to camera movement.

    upload_2022-11-23_19-36-6.png

    So A/Left arrow is left, D/Right arrow is right.

    I've had issues with the UI trying to consume those key presses, so for the moment I've deleted all UI actions.

    For the time being, I'm polling the axes in a method invoked from Update():

    upload_2022-11-23_19-37-19.png

    This works perfectly in the editor, however, when I build the game, pressing `A` results in moving right when it should move left. Pressing `D` also moves right.

    Left arrow works as expected, but both A and Left arrow are configured identically...

    upload_2022-11-23_19-40-38.png upload_2022-11-23_19-40-52.png

    The debug output shows that MoveLeftRight.ReadValue() is returning +1 for the axis when it should be -1.

    There are no other indications anything is wrong/unusual.

    Why is it flipping one half of the axis at runtime? How can I prevent this?