Search Unity

Question How to unbind an action?

Discussion in 'Input System' started by BorjaFAC90, Aug 13, 2020.

  1. BorjaFAC90

    BorjaFAC90

    Joined:
    Jul 21, 2020
    Posts:
    8
    Hi, it's me again, the guy who is learning about the new input system x)

    I am trying to unbind an action via code (overriding the actual existing with an empty one) and I cant find any way to perform this operation. Any help on this?

    Thanks!
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    One way is to set an empty override.

    Code (CSharp):
    1. playerInput.actions["fire"].ApplyBindingOverride("");
     
    BorjaFAC90 likes this.
  3. BorjaFAC90

    BorjaFAC90

    Joined:
    Jul 21, 2020
    Posts:
    8
    Will try it, thanks!