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
  3. Dismiss Notice

Feature Request Named Composite Bindings

Discussion in 'Input System' started by Tryptic_CK, Nov 17, 2022.

  1. Tryptic_CK

    Tryptic_CK

    Joined:
    Feb 6, 2021
    Posts:
    6
    It would be nice to be able to take an Action in a given ActionMap and use it as a Modifier or even a Binding in a different Action in the same ActionMap thereby allowing a player to reassign multiple bindings easily in the case of complex control schemes.

    Let's say for example I have a Selection Add key that I want the player to be able to use both for adding units to an existing selection via Selection Add + Box Select or adding to a numbered group via Selection Add + Unit Number. This means I can have a single Selection Add that the player has to rebind, and in the case where there are many of these the benefits only compound.
     
  2. X3doll

    X3doll

    Joined:
    Apr 15, 2020
    Posts:
    37
    If in your game you have the same action repeated for multiple commands, means you have to create only one action and fix this issue using your high level code.

    Ex: You have your interaction action. That's it's not binded on "SelectionAdd" or "Box Selection" because these are your high level logic used over this "Interaction Action".

    Let me know if it helps or i understand correctly your problem.
     
  3. Tryptic_CK

    Tryptic_CK

    Joined:
    Feb 6, 2021
    Posts:
    6
    Yeah, that is how I am currently handling the situation. Really, Box Select is not an action but some logic that is run inside Select's callback function if drag is true, and drag is set whenever the mouse moves far enough between performed and canceled.

    Ideally though I would want like something like this:
    Select
    Left Mouse Button
    Box Select
    Modifier: Select
    Binding: Mouse Delta
    Add Modifier
    Shift
    Select Add
    Modifier: Add Modifier
    Binding: Select
    Box Select Add
    Modifier: Add Modifier
    Binding: Box Select

    This is a fairly trivial example, but I am picturing much more complex control schemes being easier to manage, reducing the amount of conditionals in the high level input code. Obviously in the rebinding interface I would not expose all of the Actions, in this case just Select and Add Modifier. It just feels strange to have modifiers interactions and processors be a thing, and yet have to push some similar logic down into code when it doesn't necessarily need to be that way.

    Anyway, thanks for taking the time to respond.