Search Unity

When is onActionTriggered called?

Discussion in 'Input System' started by alexandre-fiset, Mar 8, 2019.

  1. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    I'm new to this input system, but I'm just trying to have actions working, with no success.

    I do this: playerInput.onActionTriggered += PlayerInput_onActionTriggered , but it never gets called.

    Is there anything specific I should be doing for it to work properly?

    I have a PlayerInputManager, I get the message of Player 1 joining, but then nothing.

    I'm using a GamePad and the default InputActionsAsset.
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Sorry for the lag here...

    Looks like the PlayerNotifications.InvokeCSharpEvents codepath has been left unfinished and only the InvokeUnityEvents, SendMessages, and BroadcastMessages paths are fully wired up ATM. Choosing one of those notification types, actions should come through fine. I'll make sure InvokeCSharpEvents gets hooked up in the next package.
     
  3. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Thanks for the response!

    I ended up following InfaillibleCoder tutorial to make the system work even without the need of a PlayerInputManager.
     
  4. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    Hello @Rene-Damm,

    Am in correct in my assessment that this is still broken as of Input System v0.9.5?

    Currently running it on Unity v2019.3.0b1.

    Thank you and be well!
    - S.
     
  5. jeslinger

    jeslinger

    Joined:
    Jul 6, 2012
    Posts:
    8
    I believe I have everything hooked up correctly. Not receiving these events as well. SendMessages is working, however. This is with a PS4 (dual shock) controller.

    If I open up the input debugger and try to log the events, I get the following error:
    Code (CSharp):
    1. Cannot find device for input event: id=2478889 type=STAT device=5 size=44 time=229.370581695561
    2. UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    3. UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr) (at C:/buildslave/unity/build/Modules/Input/Private/Input.cs:120)
     
    Last edited: Sep 7, 2019
    S_Darkwell likes this.
  6. Ithildin

    Ithildin

    Joined:
    Mar 21, 2015
    Posts:
    2
    It looks like this is still happening on v2019.3.0b4 and the package v1.0.0.

    I tried to put some breakpoints that never got hit, then checked the PlayerInput code and it looks as if it's still incomplete.

    It works using Unity event invocation, so at least there's that :).
     
    Windroid and S_Darkwell like this.
  7. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Ithildin and S_Darkwell like this.
  8. Ithildin

    Ithildin

    Joined:
    Mar 21, 2015
    Posts:
    2
    I just updated my prototype to use the patched package and C# events work now indeed, thank you!