Download

Motion Controller Menu Interaction

Hello,

First post here, longtime lurker!

So I’m building a 3D widget menu which is working fine. It uses the static mesh of the motion controller component for collisions which trigger button presses, etc. Happy with the results so far. My one question is that it only works with the right controller, I’m guessing this is because that’s the only one that is present in the motion controller blueprint?

How does the VR template mirror the right hand static mesh to become the left hand? I’m trying to figure out where to add a widget interaction component so that collisions on both hands will trigger the menu.

I’m running UE 4.13.2, with Oculus Rift and motion controllers.

Thanks!

Interesting setup actually.

The ControllerMesh is mirrored on the BeginPlay event of the MotionController blueprint. The controllers on spawn are defined to be left and right. If left->scale(1,-1,1) or something like that. That mirrors the mesh on the y-axis.

Make sure the WidgetInteractionComponent EACH WITHIN THE GAME has a unique VIRTUAL USER INDEX, otherwise you will get issues.
As you only have one blueprint for left and right hand, you need to set the virtual user index different on one of them. You can do this after the mirroring of the left hand, so it affects only one instance of the blueprint.

You might actually experiment with PointerIndex as well. Never did that though. See tooltips when hovering over in the Details panel.

cheers

Thanks, Ok, so after the spawn node I need to attach a second widget interaction component to the left hand with a unique virtual user index? I’ll try it out and see if I can get it to work. Will post when I make progress. Thanks again!

OK, so I looked at the blueprint but it doesn’t seems like it actually mirrors the hand mesh, it simply sets a new world scale, but in all the VR tutorials on motion controllers they assign the right and left hands separately. It seems like I can’t find where it actually defines a left hand motion controller? Very confused by this set up.

2017-02-07 08_10_26-VR_UMG - Unreal Editor.png

I am running into this problem as wel. did you ever found a solution to this?

Cheers

Within the Motion Controller Pawn blueprint the two variables LeftController and RightController contain a reference to the Left hand and Right hand controller respectively. You can get their value and then retrieve the Motion Controller component within them to attach an extra widget to either the left hand, the right hand or to both.

Within the MotionController_BP you can look at the value of the Hand enum variable to know whether that is the left hand or the right hand. Attaching a widget works in the same way as above.

Did I get your problem right or is there more to it?