- last edited on
I will start by explaining my situation.
I'm now working on an application and I'm using two principle assets.
A part of the unity VR sample asset, and the CurvedUI asset.
To make my application working I need to get two things:
#1 - The realtime position and rotation of the controller.
I've already been able to get it by using
Is there a more "optimized" way to reach this goal?
#2 - The realtime input state.
Here I can't find a way to get trigger/touchpad click event, and I have to admit the documentation is a bit blurry to me.
Is there an equivalent in unity of this native method?
WVR_GetInputButtonState(WVR_DeviceType type, WVR_InputId id)
@Tony PH Lin @JustinVive
Go to Solution.
You can use keyword “Change Hand Manually” to find parts of sample code.
The transform you want is
this.rightController.transform or this.leftController.transform.
Here is the Sample code: Assets/Samples/Controller_Test/Scripts/ControllerTest.cs (need to import sample.unitypackage)
// device can be : WVR_DeviceType.WVR_DeviceType_Controller_Right / WVR_DeviceType.WVR_DeviceType_Controller_Left
// buttonId can be: WVR_InputId.WVR_InputId_Alias1_Touchpad / WVR_InputId.WVR_InputId_Alias1_Trigger
WaveVR_Controller.Input (device).GetPressDown (buttonId)
WaveVR_Controller.Input (device).GetPressUp (buttonId)
WaveVR_Controller.Input (device).GetPress (buttonId)
WaveVR_Controller.Input (device).GetTouchDown (axisId)
WaveVR_Controller.Input (device).GetTouchUp (axisId)
WaveVR_Controller.Input (device).GetTouch (axisId)
2 weeks ago
- last edited
2 weeks ago
Thanks for your help,
I finally managed to make it work with your leads.
I had to use the default WaveVR prefab, I attached the WaveVR_ControllerLoader.cs script to the head.
Then I implemented the following listener:
Where I assigned the loaded controller to a GameObject.
Then, as you mentionned, I used this GO to get transform properties:
And input properties:
Sorry for the late reply.