Search Unity

Multi-Button Control

Discussion in 'Input System' started by Dragondean, Feb 15, 2019.

  1. Dragondean

    Dragondean

    Joined:
    Jun 14, 2017
    Posts:
    2
    I was just wondering how I could go about making a control that rely on multiple presses.

    Such as if I wanted to have a control that would detect click + the S key.

    An example in a real game is such as in hollow knight, if you want to cast a spell upward you have to press up and the cast button.

    How can I do that in this new system?
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    ATM it's not supported yet. There's an idea for something called "chained bindings" that's partially in the code but isn't fully implemented yet.

    With that in, you'd be able to make bindings trigger in combination. However, ATM it looks like this particular feature won't make it into 1.0-preview.
     
  3. Shaolin-Dave

    Shaolin-Dave

    Joined:
    Apr 3, 2015
    Posts:
    32
    In the meantime you can accomplish this in any of the ways you would the old system.

    ie When player is looking up, set bool isLookingUp to true. When player pushes cast button, check to see if isLookingUp is true to determine what action to take.