cancel
Showing results for 
Search instead for 
Did you mean: 

Using OVRInputModule with 2 controllers.

dalanchoo
Explorer

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.

 

dalanchoo_0-1621211574691.png

 

And these are the details of my EventSystem

dalanchoo_1-1621212215917.png

 

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

1 ACCEPTED SOLUTION

Accepted Solutions

Anonymous
Not applicable

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.

View solution in original post

2 REPLIES 2

Anonymous
Not applicable

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.

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.