NullReferenceException while executing 'InputSystem.onAfterUpdate' callbacks

We’re getting the following errors spammed to the console since upgrading to the 2023 series. This is a PS5 / PSVR2 project and although we get those errors constantly, input does seem to still work but this amount of error logging will hurt VR performance and we can’t just ignore it.

We’ve tried every version in the 2023 series but nothing has fixed it. Any ideas what is going on?

Thanks,
Reggie

NullReferenceException while executing ‘InputSystem.onAfterUpdate’ callbacks
UnityEngine.InputSystem.LowLevel.NativeInputRuntime/<>c__DisplayClass7_0:<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType,UnityEngineInternal.Input.NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType,intptr)

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.InputSystem.InputActionState.ApplyProcessors[TValue] (System.Int32 bindingIndex, TValue value, UnityEngine.InputSystem.InputControl1[TValue] controlOfType) (at ./Library/PackageCache/com.unity.inputsystem@1.6.1/InputSystem/Actions/InputActionState.cs:2820) UnityEngine.InputSystem.InputAction.ReadValue[TValue] () (at ./Library/PackageCache/com.unity.inputsystem@1.6.1/InputSystem/Actions/InputAction.cs:992) UnityEngine.InputSystem.XR.TrackedPoseDriver.UpdateCallback () (at ./Library/PackageCache/com.unity.inputsystem@1.6.1/InputSystem/Plugins/XR/TrackedPoseDriver.cs:466) UnityEngine.InputSystem.Utilities.DelegateHelpers.InvokeCallbacksSafe (UnityEngine.InputSystem.Utilities.CallbackArray1[System.Action]& callbacks, System.String callbackName, System.Object context) (at ./Library/PackageCache/com.unity.inputsystem@1.6.1/InputSystem/Utilities/DelegateHelpers.cs:21)
UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)

Can you file a bug report for this please? It would help getting the resolution prioritized.
Please link the report number here afterwards.

I get this after every live reload, i have no idea why. Would be so nice to have live reload working with the input system. Its like it looses reference to the inputs

I can confirm. I am getting the same errors.

Starting the application a second time though, it does not occur anymore. Same behavior in Editor playmode and built application.
Really annoying as I can’t suppress this.

Same error! This causes my teleportation to stop working randomly inside the application. It starts working once the player reenter the scene one or two times.

UnityEngine.InputSystem.InputActionState.ApplyProcessors[TValue] (System.Int32 bindingIndex, TValue value, UnityEngine.InputSystem.InputControl`1[TValue] controlOfType) (at ./Library/PackageCache/com.unity.inputsystem@1.6.1/InputSystem/Actions/InputActionState.cs:2820) UnityEngine.InputSystem.InputAction.ReadValue[TValue] () (at ./Library/PackageCache/com.unity.inputsystem@1.6.1/InputSystem/Actions/InputAction.cs:992) UnityEngine.XR.Interaction.Toolkit.ActionBasedController.UpdateInput (UnityEngine.XR.Interaction.Toolkit.XRControllerState controllerState) (at ./Library/PackageCache/com.unity.xr.interaction.toolkit@2.4.3/Runtime/Interaction/Controllers/ActionBasedController.cs:402) UnityEngine.XR.Interaction.Toolkit.XRBaseController.UpdateController () (at ./Library/PackageCache/com.unity.xr.interaction.toolkit@2.4.3/Runtime/Interaction/Controllers/XRBaseController.cs:356) UnityEngine.XR.Interaction.Toolkit.XRBaseController.Update () (at ./Library/PackageCache/com.unity.xr.interaction.toolkit@2.4.3/Runtime/Interaction/Controllers/XRBaseController.cs:303)

Is there a solution to this yet? The error is related to the Teleport Interactor on the RightHand. I am using Complete XR Origin Set up from the sample package.

I am also running into the same issue, except its only happening on Release builds on Android (VR project). It works perfectly fine in the Editor and also on Debug builds on Android.

Edit: It appears I was able to fix this by assigning the UIScroll action.

Thank you for the information you provided. With this information, we were able to determine that a few actions were not properly initialized in the XR Controller (Action-based) component. This occurred because the XR Interaction Toolkit was updated, but the Starter Assets within it were not. After updating the Starter Assets and referencing the updated actions in the XR Controller (Action-based) component, we were able to resolve the issue, and it did not reoccur.

Solution : Update the Starter Assets along with XR Interaction Toolkit and update the references in XR Controller(Action-based) component accordingly

1 Like

It would be really helpful if you could please be more exacting in the steps to apply the stated solution. I have been trying to update the Toolkit and the Assets over and over in different combinations, to no avail. Could you please explicitly state each step that must be done, & in what order to resolve this? It would be extremely appreciated. Which actions being updated in the starter assets caused the correct behavior? Which refs therefore needed updated in the controller? Other than clicking Reimport on the Starter assets(presumably having deleted the old existing local one(which is sadly not working for me)) was there a specific version you updated to? I’m currently fighting with XR Interaction Toolkit 2.5.1. I assume I can’t pick a different version of the samples themselves…

Thanks!

UPDATE: Nevermind! I am using the DI from this repo, and by pushing the [SerializeField] Input Action Reference for each of the 3 actions I want to fire, one stage later in the bootstrapping(to being IN the same .cs class instance where the dependency was Injected by attribute), all is now well. No more NRE errors, thank shai hulud…