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

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!