Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved When using multiple CompositeInputBinding for one action, only one can be active at a time

Discussion in 'Input System' started by downstroypvp, Jan 4, 2024.

  1. downstroypvp

    downstroypvp

    Joined:
    May 30, 2016
    Posts:
    40
    Hello!

    I have a simple configuration where the movement of my character can be controlled either by the arrow key or the WASD keys:

    upload_2024-1-4_9-58-23.png

    It looks like when I try to turn left with A while moving forward with the up arrow, only one of the input is detected, depending on the one I pressed first.

    Is it a limitation of the InputSystem or a bug?

    Thanks!
     
  2. sfider

    sfider

    Joined:
    Jan 10, 2019
    Posts:
    12
    CompositeInputBinding in this case creates one input that returns Vector2 value. You're trying to use two separate inputs bound to the same action, so Input System chooses one.

    It's definitely not a bug, rather a design decision. It could be considered a limitation in some corner cases I suppose.

    Did you try to move all the bindings (WSAD and Arrows) to one composite input? It is possible to have more then one binding for a single direction.
     
  3. downstroypvp

    downstroypvp

    Joined:
    May 30, 2016
    Posts:
    40
    Hi,

    I didn't even thought of moving all the bindings inside one composite input, as when you create a Vector2 composite binding unity automatically populates it with 4 bindings, and I thought you couldn't add more :/

    It definitively solve my problem.


    Thanks a lot!