Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

UnityEvents don't take InputAction.CallbackContext

Discussion in 'Input System' started by MaximumTre, Oct 8, 2019.

  1. MaximumTre

    MaximumTre

    Joined:
    Nov 28, 2015
    Posts:
    163
    Reading the documentation, it says to add a PlayerInput component to my player object, then configure Unity Events to handle input. But when I set up my Movement action the Unity Event doesn't receive an InputAction.CallbackContext. In my script I have the Function setup to take an InputAction.CallbackContext as an argument. Was this changed and not reflected in the documentation?
     
  2. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Which version of Unity are you on? There's a bug in early betas of 2019.3 where UnityEvents that take arguments don't work properly anymore. It has since been fixed.
     
  3. MaximumTre

    MaximumTre

    Joined:
    Nov 28, 2015
    Posts:
    163
    2019.3.0b3
     
  4. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Fixed with b4.
     
    MaximumTre and TimHeijden like this.
  5. MaximumTre

    MaximumTre

    Joined:
    Nov 28, 2015
    Posts:
    163
    Sorry, hadn't realized there was an update. That little check box was unmarked ;) Thanks.
     
  6. ajay_birla

    ajay_birla

    Joined:
    Apr 29, 2016
    Posts:
    2
    We're facing the same issue in 2019.2.5f1. Any FIX for this specific version of Unity?
     
  7. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Unfortunately no. It's a native side fix and thus requires an update to a newer version of 2019.2.
     
  8. robtown

    robtown

    Joined:
    Jul 9, 2013
    Posts:
    3
    So in Unity 2020.1.6f1... has this been "fixed".
    Because when I try to use InputAction.CallbackContext in my input callback, the callback is never fired. If I change it to InputValue, the callback is then fired properly... but three times per button click.