Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException: Object reference not set to an instance of an object #1112

Open
CrisChenYingyan opened this issue May 8, 2024 · 0 comments

Comments

@CrisChenYingyan
Copy link

I have configured the variable SteamVR_Action_Boolean MovePress to detect whether the trackpad on the HTC Vive controller is pressed. I have also bound this action to the controller using SteamVR input. Additionally, I set movePress = SteamVR Actions.default.m_MovePress. However, when I check the status of MovePress using if (movePress.GetStateDown(SteamVR_Input_Sources.Any)), I encounter the following error.

NullReferenceException: Object reference not set to an instance of an object
Valve.VR.SteamVR_Action_Boolean_Source.UpdateValue () (at Assets/SteamVR/Input/SteamVR_Action_Boolean.cs:415)
Valve.VR.SteamVR_Action_In_Source_Map1[SourceElement].ForceAddSourceToUpdateList (Valve.VR.SteamVR_Input_Sources inputSource) (at Assets/SteamVR/Input/SteamVR_Action_In.cs:217) Valve.VR.SteamVR_Action_In_Source_Map1[SourceElement].OnAccessSource (Valve.VR.SteamVR_Input_Sources inputSource) (at Assets/SteamVR/Input/SteamVR_Action_In.cs:192)
Valve.VR.SteamVR_Action_Source_Map1[SourceElement].GetSourceElementForIndexer (Valve.VR.SteamVR_Input_Sources inputSource) (at Assets/SteamVR/Input/SteamVR_Action.cs:607) Valve.VR.SteamVR_Action_Source_Map1[SourceElement].get_Item (Valve.VR.SteamVR_Input_Sources inputSource) (at Assets/SteamVR/Input/SteamVR_Action.cs:573)
Valve.VR.SteamVR_Action_Boolean.GetStateDown (Valve.VR.SteamVR_Input_Sources inputSource) (at Assets/SteamVR/Input/SteamVR_Action_Boolean.cs:80)
PlayerController.FixedUpdate () (at Assets/Scripts/PlayerController.cs:39)

How should I modify it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant