Search Unity

Bug Using the New Input System makes errors

Discussion in 'Editor & General Support' started by moplo, May 25, 2020.

  1. moplo

    moplo

    Joined:
    Aug 3, 2018
    Posts:
    3
    The error goes something like this.

    ArgumentNullException while executing 'started' callbacks of 'Player/Push[/Mouse/leftButton,/Keyboard/s]'
    UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/Input/Private/Input.cs:120)


    I am using the Player Input Component with "Send Unity Events". Not sure why this happens. Can I have some help with fixing this?
     
  2. moplo

    moplo

    Joined:
    Aug 3, 2018
    Posts:
    3
    I would like some help as to why this happens.
     
  3. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,911
    Is it possible your event handling code is throwing an ArgumentNullException? That's what the error implies.
     
  4. moplo

    moplo

    Joined:
    Aug 3, 2018
    Posts:
    3
    Fixed. The array was null. I used
    Code (CSharp):
    1. new RaycastHit2D[2]
    and that fixed it.