0
\$\begingroup\$

We're making a sailing game in VR for Vive Pro, where you hold the rudder with your left hand using a Vive controller. We use just one controller because there's nothing to do with your other hand, and the rudder is on the left side of the player (it's a seated setup). The second controller will be charging, or it will be off while the game is being played.

We use the Player prefab that comes with the Steam VR Unity Plugin, that has GameObjects for both the left and right hand, with the option to show controllers and/or hand skeletons that move according to what controls you're using on the controllers.

The problem is that when only one controller is on and detected by Steam VR, it decides to show the right hand, instead of the left hand that we're holding it with.
When both controllers are switched on and connected, it works as expected. The left hand controller is at the player's left side as long as the unused controller is located at the player's right side.

I tried putting a left handed skeleton on the right hand controller gameObject in the Player prefab, but that resulted in an unresponsive skeleton (not visualising the interaction of the player with the controller).

How can we make it so that when using only one controller, it shows as the left hand?

Image of virtual and real controller So what we want is like in this picture, hold the controller with one hand (normally the left hand) except always showing a left virtual hand in the application, and still mimicking whatever controls the user is pressing on the real controller.

\$\endgroup\$
  • \$\begingroup\$ This question was originally posted on Stack Overflow but got no answers. Hope to get some insights here! \$\endgroup\$ – frankhermes Nov 18 '19 at 7:47
  • 1
    \$\begingroup\$ One thing to keep in mind as you set this up is that not every player has a left hand. As you set up the left hand default, try not to close the door to a right-handed mode for players who need it to enjoy your game comfortably. \$\endgroup\$ – DMGregory Nov 18 '19 at 12:50
1
\$\begingroup\$

you should be able to update the mappings using the tool described here: https://www.pcgamer.com/valve-now-lets-you-map-your-own-custom-controller-bindings-in-steamvr/

But you might also have luck by adding the Unity tracked-pose-driver to your rudder and manually selecting which controller you'd like to use: https://docs.unity3d.com/2018.3/Documentation/ScriptReference/SpatialTracking.TrackedPoseDriver.html

Hope this helps!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks, the controller bindings system is something I can't get my head around, having tried a lot of things already without really understanding what it does. The TrackedPoseDriver you mention looks interesting, could you elaborate on that? The API descriptions from Unity are cryptical at best, as usual with Unity's documentation. Could I somehow set the controller that is internally mapped to the right hand pose to show a left hand skeleton on the visualization of the controller in my game? What properties would I have to use? \$\endgroup\$ – frankhermes Nov 26 '19 at 14:32
  • \$\begingroup\$ Sure: I'd start by adding a cube or capsule to your scene, then add the tracked pose driver component to it. You'll see it gives you some options about whether it's a headset or controller, left hand or right, etc. Hit play and move the controller around to verify it works with the controller you want. Do you visualize the person in the boat or just the rudder? If it's a fully rigged human skeleton you'll want to attach the wrist bone to the controller's position and rotation with whatever you're using to drive the rig. \$\endgroup\$ – Dave Seidman Nov 26 '19 at 14:49
  • \$\begingroup\$ Woops that fails immediately because I'm using 2019.2 (should probably have mentioned that). The whole SpatialTracking stuff seems to be missing there. We just visualize the controller and a hand skeleton on it, by the way. \$\endgroup\$ – frankhermes Nov 26 '19 at 15:55
  • \$\begingroup\$ OK I installed the XR Legacy Input Helpers package. That gives me the option to add the TrackedPoseDriver. And the cube moves when my controller moves. BUT when the pose driver is set to use the left controller as its pose source, and steam decides to map my controller to the right hand, nothing happens. This is the annoying issue I face, that steam defaults to map the right hand when using one controller. So I fear this path is not going to lead me to a solution... \$\endgroup\$ – frankhermes Nov 26 '19 at 16:08
  • 1
    \$\begingroup\$ Ah, interesting. I guess your version of steam (or maybe all versions) assign handedness based on which controller turns on first. reddit.com/r/Vive/comments/62r338/… are you planning on using each controller in different installations of your app? If so you can just map the hand in unity to whichever one steam always picks first. Or maybe I'm misunderstanding and you need both handsets at once? \$\endgroup\$ – Dave Seidman Nov 26 '19 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.