Announcement

Collapse
No announcement yet.

Thumbstick movement with Touch issue

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

    [OCULUS] Thumbstick movement with Touch issue

    Hi,

    I'm trying to implement a standard thumbstick movement into a Touch project but I'm having a few issues. I've been prototyping in the VR Template project and I've added a Character BP and copied over the logic from the MotionControllerPawn and added the following logic for movement:

    Click image for larger version

Name:	2017-01-07_14-11-24.png
Views:	1
Size:	97.6 KB
ID:	1205046

    Click image for larger version

Name:	2017-01-07_14-28-10.png
Views:	1
Size:	17.8 KB
ID:	1205047

    This kind of works, however whenever I "grab" using either trigger while moving with the thumbstick the pawn gets pushed in a different direction. Can anyone please help me out?

    Link to question on Answerhub: https://answers.unrealengine.com/que...ent-issue.html

    Thanks

    #2
    Did you ever find a solution for this? I am running into the same problem

    Comment


      #3
      Originally posted by CSandeman View Post
      Did you ever find a solution for this? I am running into the same problem
      Unfortunately not, I ended up giving up on using that method of locomotion. Let me know if you have any luck

      Comment


        #4
        In the VR Template - MotionControllerMap, the VRPawn is derived from Pawn, not from DefaultPawn, so it doesn't have a Motion Component by default. Add Movement Input doesn't work in this case, unless you implemented something in your Event Tick.

        If you start from the VR Template, in the MotionControllerMap, add the following to the Event Graph of the Pawn to implement Thumbstick based movements (you can similarly add a rotation using the X axis of the Right Thumbstick).

        Click image for larger version

Name:	Capture.PNG
Views:	2
Size:	144.4 KB
ID:	1124228

        To make the movement faster, you can multiply the output of the Motion Controller axis by a float > 1.0. To make the rate of movement independent from the FPS, you can multiply it by Get World Delta Seconds.

        Hope this helps!

        Cheers,
        Marco.
        CTO | Head of VR Development - Visit us at http://humanxr.com
        My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

        Comment


          #5
          Marco's solution gets movement working, but only in world space. I'm trying to add functionality to this so when I press forward on the thumbstick it moves forward relative to where the HMD is looking. Any help pointing me in the right direction (pun intended) would be most appreciated.
          Dan Jenkins
          Sr. Attraction Designer
          Universal Creative, NBC/Universal

          Comment


            #6
            Originally posted by DarkRideJenkins View Post
            Marco's solution gets movement working, but only in world space. I'm trying to add functionality to this so when I press forward on the thumbstick it moves forward relative to where the HMD is looking. Any help pointing me in the right direction (pun intended) would be most appreciated.
            In the blueprint above, just use the forward vector of the VR Camera rather than the one from the root component of the pawn. That will move you along the direction you are looking at. This said, you will also need to implement a bit of rotation to also turn the "body" (aka the pawn root component) in the same direction otherwise you will soon get neck strain. Speaking out of experience. ;-)
            CTO | Head of VR Development - Visit us at http://humanxr.com
            My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

            Comment


              #7
              I've tried using the VR Camera rather than the Scene Root. No change in behavior, control is exactly the same either way.
              Dan Jenkins
              Sr. Attraction Designer
              Universal Creative, NBC/Universal

              Comment


                #8
                Originally posted by DarkRideJenkins View Post
                I've tried using the VR Camera rather than the Scene Root. No change in behavior, control is exactly the same either way.
                Ok, I don't know what is wrong with your project, I would have to take a look to be able to tell. Please try the following:

                - Create a brand new 4.17.2 VR Project from the standard Epic template
                - Open the Motion Controller Map
                - Click on the VRPawn which is in the level and in the World Outliner click on Edit MotionControllerPawn

                Now, inside the Event Graph of the MotionControllerPawn do the following:

                - (OPTIONAL) Under Event BeginPlay, fix the Switch so it handles correctly the Oculus as OculusHMD. This will make sure you start with the proper height above the floor.

                Click image for larger version

Name:	2017-10-13 17_41_39-MotionControllerPawn.png
Views:	299
Size:	67.2 KB
ID:	1368963

                - Disconnect all execution pins from the Execute Teleportation, Input Action TeleportLeft, Input Action TeleportRight, Event Tick.

                Click image for larger version

Name:	2017-10-13 17_45_40-MotionControllerPawn.png
Views:	293
Size:	25.9 KB
ID:	1368964
                Click image for larger version

Name:	2017-10-13 17_44_09-MotionControllerPawn.png
Views:	292
Size:	44.7 KB
ID:	1368965
                Click image for larger version

Name:	2017-10-13 17_43_30-MotionControllerPawn.png
Views:	274
Size:	41.6 KB
ID:	1368967

                - Add the new controls to handle movement and rotation (see attachment). Movement is dependent from the HMD orientation (e.g. move the stick forward and you will be moving toward the direction you are looking at).

                Click image for larger version

Name:	2017-10-13 17_48_18-MotionControllerPawn_.png
Views:	263
Size:	117.9 KB
ID:	1368968

                That's it. Let me know how it works.
                Attached Files
                CTO | Head of VR Development - Visit us at http://humanxr.com
                My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                Comment


                  #9
                  I am so grateful to you Marco. Fantastic explanation and worked perfectly! So amazing of you to go to such detail.

                  I think the issue I had was my AddWorldOffset nodes were targeting a Scene Component (the camera) and they were not AddActorWorldOffset nodes.

                  This funtionality is great, but of course it brings up so many other questions. I'm going to play around a bit and see if I can figure out how to limit the motion to the X/Y plane and not allow the player to float through the floor. Wish me luck.
                  Dan Jenkins
                  Sr. Attraction Designer
                  Universal Creative, NBC/Universal

                  Comment


                    #10
                    Originally posted by DarkRideJenkins View Post
                    I am so grateful to you Marco. Fantastic explanation and worked perfectly! So amazing of you to go to such detail.

                    I think the issue I had was my AddWorldOffset nodes were targeting a Scene Component (the camera) and they were not AddActorWorldOffset nodes.

                    This funtionality is great, but of course it brings up so many other questions. I'm going to play around a bit and see if I can figure out how to limit the motion to the X/Y plane and not allow the player to float through the floor. Wish me luck.
                    You are welcome Dan. Glad it helped. :-)

                    This is exactly the reason why the Project Vector on to Plane nodes are being used. Even if you look up or down, they constrain the Delta Location vector to the XY plane so there is no vertical movement.

                    Good luck with your experiments!
                    CTO | Head of VR Development - Visit us at http://humanxr.com
                    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                    Comment


                      #11
                      Marco, thank you. Your solution was very helpful for me too.

                      Comment


                        #12
                        Hi Marco
                        I wanted to say a big thanks for your tutorials, they are really really helpful.
                        I have used both of your locomotion thumb stick tutorials, combined them together ( probably breaking some fundamental rules and making a real dogs dinner). I can now move and look independently and climb stairs. I am experience some some issue with locomotion which is if I grab something ( with sweep turned on ) I then cant seem to move properly until I let go, Ideally I would like to be able to move around whilst holding objects and climb stairs.

                        Click image for larger version

Name:	walk and climb.JPG
Views:	269
Size:	120.4 KB
ID:	1463469

                        Click image for larger version

Name:	walk and climb 1.JPG
Views:	279
Size:	17.6 KB
ID:	1463470

                        I hope this makes sense

                        Many thanks

                        Comment


                          #13
                          sfenton Check your collisions, it is possible that something is interfering with the capsule and preventing your character to move.
                          CTO | Head of VR Development - Visit us at http://humanxr.com
                          My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                          Comment


                            #14
                            Thanks Marco, I found that when I am grabbing an object, if the object is intersecting the player capsule it stops movement, shrinking the capsule radius to 22 seems to do the trick

                            Comment


                              #15
                              Originally posted by sfenton View Post
                              Thanks Marco, I found that when I am grabbing an object, if the object is intersecting the player capsule it stops movement, shrinking the capsule radius to 22 seems to do the trick
                              Great that you found the issue and solved it!
                              CTO | Head of VR Development - Visit us at http://humanxr.com
                              My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                              Comment

                              Working...
                              X