Forum Discussion
VJ76
6 years agoProtege
How can i switch the laserpointer (UIHelper) from right to the left controller?
When adding the UIHelper prefab from the OculusIntergration, it directly assigns it to the right controller. How can i switch it to the left controller?
Do need to change the HandedInputSelector.cs?
Do need to change the HandedInputSelector.cs?
7 Replies
- bruno.fantiniExplorer
Hi, so this worked for me using the Quest 2 /unity 2020.3
Modify the Update Method in HandedInputSelector.cs , so that the left controller is always set as active in every frame:
void Update() { //if(OVRInput.GetActiveController() == OVRInput.Controller.LTouch) //{ SetActiveController(OVRInput.Controller.LTouch); //} //else //{ // SetActiveController(OVRInput.Controller.RTouch); //} } - FuzzyOnionProtegeRunning into the same problem but the code above did not work for me... (On the Oculus Go)
- Anonymousif (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger,OVRInput.Controller.RTouch)){SetActiveController(OVRInput.Controller.RTouch);}if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger, OVRInput.Controller.LTouch)){SetActiveController(OVRInput.Controller.LTouch);}
Replace Update code of HandedInputSelector.cs class and it starts working for both controllers - WeitinProtegeI found out the OVRInputModule's RayTransform was being set every frame in HandedInputSelector included in the UIHelperPrefab.
- WeitinProtegeHey I took a look, and here are my findings. I debugged OVRInputModule and found that RayTransform is always set to the RightHandAnchor. Even setting it to something else at runtime doesn't change it. This leads me to believe that this value is automatically set by Oculus according to the OVRInput.GetDominantHand(). However, I found no way of setting the dominant hand (only getting) through code or even in the user settings for that matter. So it seems the laser is stuck to right hand. I'll contact Oculus about this, but I don't see this being fixed quickly.
- VJ76Protege@Weitin Thx for your answer, but it is not working.
- WeitinProtegeI can't confirm if this works, but I believe set the Ray Transform to LeftHandAnchor in OVRInputModule found in UIHelpers > EventSystem.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device