Announcement

Collapse
No announcement yet.

Trouble Adding Line Trace to Hand in VR Template

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.
    Attached Files

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

    Click image for larger version

Name:	eyess.JPG
Views:	1
Size:	92.5 KB
ID:	1123638

    Comment


      #3
      Thanks for the quick response. I tried that and it still did not work(https://screencast.com/t/Wcqjf3duz2cd). 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.
      Attached Files

      Comment


        #4
        I'm using the VR (OpenVR) Expansion Plugin https://forums.unrealengine.com/show...pansion-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.

        Comment


          #5
          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.


          Consider supporting me on patreon

          My Open source tools and plugins
          Advanced Sessions Plugin
          VR Expansion Plugin

          Comment


            #6
            Originally posted by tcla75 View Post
            I'm using the VR (OpenVR) Expansion Plugin https://forums.unrealengine.com/show...pansion-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.
            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.
            Last edited by atc07; 02-21-2017, 04:35 PM.

            Comment


              #7
              Originally posted by mordentral View Post
              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.
              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.)

              Comment


                #8
                Originally posted by atc07 View Post
                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.


                Consider supporting me on patreon

                My Open source tools and plugins
                Advanced Sessions Plugin
                VR Expansion Plugin

                Comment

                Working...
                X