NullReferenceException: Object reference not set to an instance of an object
CrisChenYingyan opened this issue · 2 comments
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_Map
1[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_Map
1[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?
Have got the solution???? I need it urgently