05-16-2021 05:56 PM - edited 05-16-2021 05:57 PM
Hello.
I am trying to figure out how to use the OVRInputModule in my game with 2 controllers. I want to have 2 laser beam that comes out of each controller, very similar to how the UI works in the dashboard. However, I can only get one laser to move and be attached to its controller at once.
This is my hierarchy.
And these are the details of my EventSystem
In the OVRInputModule, if the RayTransform and Cursor are set to the ConquestOVRLaserPointer that is a child of the RightControllerAnchor, the laser attached to the right controller will move when the right controller does, but the left laser will not move. If, on the other hand, I set the RayTransform and Cursor to the ConquestOVRLaserPointer that is a child of the LeftControllerAnchor, then the laser attached to the left controller will move when the left controller does and the right laser will not move.
Since there is only one on RayTransform and Cursor slot, how do I get it so that the lasers attached to both controllers can move at once?
Thanks for any help
John Lawrie
Solved! Go to Solution.
05-17-2021 10:31 AM
The OVRInputModule included in the Oculus Integration samples seems to have been designed with a single controller in mind. It was probably designed during the GearVR era and hasn't been significantly updated. It isn't trivial to modify it to support simultaneous dual touch controllers. You can set it up to swap between the two controllers, so when you press a button on a controller it becomes the active raycaster, but even that requires a bit of custom code.
You might want to take a look at Unity's XR Interaction Toolkit: https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@1.0/manual/index.html
It's still in preview, but can be installed through Unity's package manager. The part that is currently working acceptably is two "Ray Interactors" simultaneously interacting with a UI Canvas.
05-17-2021 10:31 AM
The OVRInputModule included in the Oculus Integration samples seems to have been designed with a single controller in mind. It was probably designed during the GearVR era and hasn't been significantly updated. It isn't trivial to modify it to support simultaneous dual touch controllers. You can set it up to swap between the two controllers, so when you press a button on a controller it becomes the active raycaster, but even that requires a bit of custom code.
You might want to take a look at Unity's XR Interaction Toolkit: https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@1.0/manual/index.html
It's still in preview, but can be installed through Unity's package manager. The part that is currently working acceptably is two "Ray Interactors" simultaneously interacting with a UI Canvas.
05-20-2021 10:10 PM
I ended up modifying my OVRRawRaycaser to update the position of my lasers. I think I will probably do as you suggest and swap between the 2 controllers as necessary.