Search Unity

Feature Request PlayerInput OnBindingChanged Callback

Discussion in 'Input System' started by lejean, Jul 15, 2022.

  1. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    392
    I'm updating my key rebinding system by using the rebinding example supplied in the Input samples.

    This works to an extent but I have a local co-op game, so I'm using the PlayerInput components.

    First I tried to add player separated logic to the RebindActionUI script in the sample, but it's quite the hassle.

    Then I noticed that playerInput has a onControlsChanged callback which I'm trying to work with now which might work better, but this is more of a global "something changed" event. So this would update everything that plugs in to it, even tho it wasn't necessarily changed.

    Isn't there some kind of onInputActionBindingChanged event in playerInput where I can just compare the assigned InputAction with the input action that changed and update only that UI accordingly.