Hi there,
I’m having issues with the script Input Action State from the XR interaction toolkit package.
I have made a climbing wall with a climbing system following this tutorial:
So in the beginning used to work properly, but suddenly when I implemented this system in other scene it stopped working (on both scenes), the problem now is when I try to grab a knob to push me up, the player movement seems to be disabled or freezed when I release the knob, so I can’t move again.
This is the Exception thrown:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.InputSystem.InputActionState.ApplyProcessors[TValue] (System.Int32 bindingIndex, TValue value, UnityEngine.InputSystem.InputControl`1[TValue] controlOfType) (at Library/PackageCache/com.unity.inputsystem@1.5.0/InputSystem/Actions/InputActionState.cs:2820)
UnityEngine.InputSystem.InputAction.ReadValue[TValue] () (at Library/PackageCache/com.unity.inputsystem@1.5.0/InputSystem/Actions/InputAction.cs:992)
UnityEngine.XR.Interaction.Toolkit.ActionBasedContinuousMoveProvider.ReadInput () (at Library/PackageCache/com.unity.xr.interaction.toolkit@2.2.0/Runtime/Locomotion/Continuous/ActionBasedContinuousMoveProvider.cs:62)
UnityEngine.XR.Interaction.Toolkit.ContinuousMoveProviderBase.Update () (at Library/PackageCache/com.unity.xr.interaction.toolkit@2.2.0/Runtime/Locomotion/Continuous/ContinuousMoveProviderBase.cs:130)
This is the function called, line 2820 is throwing the exception:
I have exactly the same bug. Unfortunately it has floating nature and is hard to catch intentionally, but right now I have particular state of the project where it is reproducing reliably. But since I can’t file you a whole production project with my report, I’ll try to describe here what I’ve discovered.
In some conditions which I can not define the RayInteractor I using as a teleportation pointer is starting to spam exceptions when activated and enters selection mode. The strange thing is that I use two completely identical instances of the same TeleportInteractor prefab with just two input fields differs at the ActionBasedController component (left and right thumbsticks input for teleportation). And somehow one of the interactors is spamming with exceptions (in Editor play mode) and other is not, though both are kinda working besides those exceptions. But in Quest build those exceptions are leading to crash. The next interesting part is that if I start my app on device and won’t use the right teleport interactor (one that leads to exceptions) and instead skip few seconds or try to use the left teleport interactor, eventually it will allow me to use the right one without crash.
The exception is always the same in my case:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.InputSystem.InputActionState.ApplyProcessors[TValue] (System.Int32 bindingIndex, TValue value, UnityEngine.InputSystem.InputControl`1[TValue] controlOfType) (at Library/PackageCache/com.unity.inputsystem@1.4.4/InputSystem/Actions/InputActionState.cs:2820)
UnityEngine.InputSystem.InputAction.ReadValue[TValue] () (at Library/PackageCache/com.unity.inputsystem@1.4.4/InputSystem/Actions/InputAction.cs:987)
UnityEngine.XR.Interaction.Toolkit.XRRayInteractor.TryRead2DAxis (UnityEngine.InputSystem.InputAction action, UnityEngine.Vector2& output) (at Library/PackageCache/com.unity.xr.interaction.toolkit@2.2.0/Runtime/Interaction/Interactors/XRRayInteractor.cs:1218)
UnityEngine.XR.Interaction.Toolkit.XRRayInteractor.ProcessInteractor (UnityEngine.XR.Interaction.Toolkit.XRInteractionUpdateOrder+UpdatePhase updatePhase) (at Library/PackageCache/com.unity.xr.interaction.toolkit@2.2.0/Runtime/Interaction/Interactors/XRRayInteractor.cs:1402)
UnityEngine.XR.Interaction.Toolkit.XRInteractionManager.ProcessInteractors (UnityEngine.XR.Interaction.Toolkit.XRInteractionUpdateOrder+UpdatePhase updatePhase) (at Library/PackageCache/com.unity.xr.interaction.toolkit@2.2.0/Runtime/Interaction/XRInteractionManager.cs:390)
UnityEngine.XR.Interaction.Toolkit.XRInteractionManager.Update () (at Library/PackageCache/com.unity.xr.interaction.toolkit@2.2.0/Runtime/Interaction/XRInteractionManager.cs:307)
public InputProcessor[] processors;
That processors array declared on the line 85 is null, that’s why the exception is thrown.
Hi, I was getting the same issue and just fixed it so this might help others:
In my case I was using an XR Ray Interactor for each hand, and disabling their gameObjects by script in certain circumstances (like if you’re about to grab an object, don’t want to interact with a UI element during that). I guess as soon as you do that the input system kind of loses track of them and doesn’t find them again if you re-enable the objects later, leading to that array being null and the error spam. I got around the issue by addressing the XR Ray Interactor component directly and disabling that instead of the gameObject it’s attached to.
Hope this helps anyone who’s been stuck on this for days/weeks as well!
It happens here too. For my case it was during the teleportation, specifically when releasing the thumbstick to initiate the teleport. The player won’t move and there will be this error firing rapidly while the thumbstick is being pushed in any direction. This is on a IL2CPP build running on Quest 2. I’m on version 2.4.0. I believe it happen on 2.3.x as well, as I specifically upgrade because of this bug.
NullReferenceException: Object reference not set to an instance of an object.
at UnityEngine.InputSystem.InputActionState.ApplyProcessors[TValue] (System.Int32 bindingIndex, TValue value, UnityEngine.InputSystem.InputControl`1[TValue] controlOfType) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputAction.ReadValue[TValue] () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.XR.Interaction.Toolkit.ActionBasedController.UpdateInput (UnityEngine.XR.Interaction.Toolkit.XRControllerState controllerState) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.XR.Interaction.Toolkit.XRBaseController.UpdateController () [0x00000] in <00000000000000000000000000000000>:0
Have you tried using a fresh update of the Starter assets sample and grabbing the rig there to see if anything helps? I suspect that in upgrading XRI you have have an action based controller reference with missing input actions.
I also recommend doing a Reimport All on your repo after ugprading.
I’m seeing this as well. Usually pops up when initializing, but sometimes just randomly occurs.
Unity 2021.3.20f1
XRITK 2.4.3
XRPM 4.4.0
The app is mixed Desktop/VR where you can enabled/disable it and I noticed that a lot of the input stuff does not like to share rights. I have to disable the Input System UI Input Module if entering VR mode if I want to read the XR inputs. Could be tangentenially related?
Did anyone find any fix for this?
Even we are getting this issue in oculus quest 2. When that error occurs, clicks with the controller which we are actively using are not working, but the clicks with the other controller are working fine. This issue pops up randomly when playing game. Most of the times, this issue is occurring when headset is unmounted and mounted.
We are using
Unity 2022.3.5f1
Oculus SDK v55
XR Interaction Tool Kit 2.4.0
Input System: 1.6.1
For anyone facing this issue, 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
Unity 2022.3.9f1
XR Interaction Toolkit 2.5.1
Input System 1.7.0
For us, the culprit is a bad null check in ActionBasedController.UpdateInput method. The controller was configured such that the UI Scroll Action was not using a reference and it didn’t have any action configured. However, in this case, InputActionProperty.action will return an instance of InputAction that is empty, not null. The ActionBasedController only checks if the action is null, not if the action is empty. This eventually results in a null reference when calling InputAction.ReadValue then InputActionState.ApplyProcessors.
var uiScrollAction = m_UIScrollAction.action;
if (uiScrollAction != null) <- Bad check
controllerState.uiScrollValue = uiScrollAction.ReadValue<Vector2>();
As a workaround until the code is fixed, we checked the “Use Reference” box for the UI Scroll Action and simply left the reference null.
Hopefully that helps.
EDIT: Also encountered a similar issue with XRRayInteractor and the translate/rotate anchor inputs. A similar check against null causes the same error.
static bool TryRead2DAxis(InputAction action, out Vector2 output)
{
if (action != null) <- Bad check
{
output = action.ReadValue<Vector2>();
return true;
}
output = default;
return false;
}
Hey all, we had this error too and it seemed to occure completely random (Version 2.4.3). Our solution was very simple: The error seems to occur when you have TeleportationArea Scripts on Object with non convex colliders. So we just switched the colliders on the teleportation targets to “convex” and everything worked fine.
Hey, are you sure it is the correct patch to disable and enable XRInteractionManager to fix the issue? We were thinking about disabling and enabling InputActionManager, not XRInteractionManager
Have reimported all assets, in particular the XR Interaction Toolkit AND the Sample Starter Assets (don’t have any older versions of either of these in the project either)
Still getting the same/similar error related to UI scroll, seems to happen very randomly, but looks like when it does occur it’s after a controller-node has regained tracking (note: below is example occurence from a WMR odyssey, but we have also seen this with Oculus Q2 and Q3). I am going to try the workaround suggested by @jdh5259 : “As a workaround until the code is fixed, we checked the “Use Reference” box for the UI Scroll Action and simply left the reference null.”
EDIT: I just realized that in one scene the UI scroll action was NOT assigned and the checkbox for ‘use reference’ was NOT checked. stay tuned for update.
Tracking lost: RightHand, Windows MR Controller OpenXR, Microsoft, SN: Tracking acquired: RightHand, Windows MR Controller OpenXR, Microsoft, SN: Uploading Crash Report NullReferenceException: Object reference not set to an instance of an object at UnityEngine.InputSystem.InputActionState.ApplyProcessors[TValue] (System.Int32 bindingIndex, TValue value, UnityEngine.InputSystem.InputControl`1[TValue] controlOfType) [0x00034] in :0 at UnityEngine.InputSystem.InputAction.ReadValue[TValue] () [0x00044] in :0 at UnityEngine.XR.Interaction.Toolkit.ActionBasedController.UpdateInput (UnityEngine.XR.Interaction.Toolkit.XRControllerState controllerState) [0x00178] in <0b9c3e1074d44699820609e0acc847f5>:0 at UnityEngine.XR.Interaction.Toolkit.XRBaseController.UpdateController () [0x00048] in <0b9c3e1074d44699820609e0acc847f5>:0 at UnityEngine.XR.Interaction.Toolkit.XRBaseController.Update () [0x00000] in <0b9c3e1074d44699820609e0acc847f5>:0
I just got this error today—suddenly my right hand teleporter doesn’t work and throws all these system input errors if I teleport first with my left hand. If I teleport first with the right, then both seem to work.
I did just happen to put a teleport area component on a piece of level geometry with a non-convex collider, so I’ll try getting rid of that and see if it fixes it.
Edit: Booted my project up, and now I can’t reproduce the error. Anyway, the few ground objects I have with non-convex colliders also have deep box colliders below the surface (to make sure objects get ejected upward if the player pushes them through the floor), so I think I’ll just use those colliders and not the non-convex surface for my teleportation area.
On the other hand, I do enable and disable my teleport ray interactors regularly depending on the interaction context, and I also turn the interactor game objects on and off when the player configures their control settings, so I suppose either of those could contribute, going by some of the comments in this thread. I’ll keep an eye on it and try to test more often in teleport-only mode.
Edit 2: The errors came back–it has only happened right after changing the control settings in-game, so I figure it’s due to activating/deactivating the teleporter game objects. I’ve reworked my player settings so that I don’t ever deactivate them, and just disable the interactors when needed. The error hasn’t returned in my testing so far.
I had the same error as above and it was due to my VRLocomotionManager disabling the GameObject with XRRayInteractor and on it. I rewrote the code to disable the XRRayInteractor and XRInteractorLineVisual components instead of wherever the GameObject was disabled and enabled previously and I haven’t had the error since.
I get the same error. It happens when I am opening the Quest menu screen where you can close the app or start recording. In this moment I open the pause menu in the game. This enables my UI interaction controller.