Trouble Adding Line Trace to Hand in VR Template

I have created my own UE4 Project using the Vive motion controllers with working tracking and functionality, but thought the VR Template UE4 provides provides some cool functionality with the hand movements. I have been able to add a line trace using the Vive motion controllers on my own created project, but when using the VR Template the hands in the VR Template are providing some issues. It’s almost like the line trace is getting blocked or something. I have set it up in the BP_MotionController Blueprint so that when I select the motion controller left trigger, then the line trace is supposed to fire off. When I try it with the Motion Controller Pawn Blueprint to test, I can successfully fire off the line trace from the HMD; however I cannot get it to work with the hands in the BP_MotionController Blueprint. I have attached the blueprint screenshot and believe everything is correct. Could someone let me know what I am doing wrong or maybe suggest something I haven’t tried yet?

Any help would be much appreciated.

Try adding a camera component to the controller and add that to the get world location and get forward vector.


Thanks for the quick response. I tried that and it still did not work( Any other thoughts? I noticed that you separated into 2 motion controllers instead of using the template that generates the controllers in the game. What do you think about the VR Template in general? Is it a headache to work with? Would it be easier for me to work with the template I made, which uses the Vive motion controllers instead of hands? Still new here and getting my grasp with UE4 so appreciate the input.

I’m using the VR (OpenVR) Expansion Plugin and just modifying the MotionControllerPawn that comes with the VR template and adding the VRCharacter from the plugin in the pawn class settings. That gives me the separate left and right controllers. I just saw that you have set up the line trace with the motion control L trigger is there any reason for that? If not try running it off a tick instead and see how that works.

Add the actor the motion controller is attached to, to the ignored list for the trace. Without ignoring the actor the trace will just end the moment is touches something that the visibility channel collides with (just about everything), and that could be your hand mesh.

The motion controller zero point is actually just at the base of the ring on the vive controller, not entirely sure where the tracking zero location is for touch controllers.

The difficult thing is that I’m building the game on both a Mac(for travel) and PC. Last time I tried, adding the OpenVR Expansion Plugin wouldn’t allow me to open the project on my Mac. Is there a more effective and not too advanced way that I should be doing this?

I’m setting up the line trace with the motion controller trigger as I’m eventually tying it to an action, but the first step is making sure the line trace works. I read that an Event Tick can take up unwanted CPU usage also?

Thanks for the suggestions - I’ll give it a try and let you know of any progress.

I’m using the Vive and will also give this a try. I will post any updates. (Also, thank you for taking the time to answer this and helping me out. I am just starting to learn UE4 and trying to figure it out myself as much as possible first, unless I’m really stuck.)

Print out what it hit too, will help you to debug it.

Posting this in case it helps anyone. When setting up a trace with the VR template hand I realized it wasn’t working because the trace was always colliding with the VR hand itself and not even getting out of the gate so to speak. You need to make sure that the VR hand is ignored by the trace.

Thank you for your advice. I used “make array” to ignore HandMesh, but I still cannot see the trace. Could you please tell me what should I do to fix this issue?