Download

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:

ee97d9d1b15fb3d13192d8a1e0d382d46ae0d426.png

49c8cc7e0aadb0848756ad30b0cee2453f5ad370.png

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/questions/545724/vr-template-oculus-touch-thumbstick-movement-issue.html

Thanks :slight_smile:

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

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).

Thumbstick movement.PNG

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.

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. :wink:

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.

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

2017-10-13 17_45_40-MotionControllerPawn.png


2017-10-13 17_43_30-MotionControllerPawn.png

  • 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).

That’s it. Let me know how it works.

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. :slight_smile:

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!

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

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.

walk and climb 1.JPG

I hope this makes sense

Many thanks

@sfenton Check your collisions, it is possible that something is interfering with the capsule and preventing your character to move.

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!

Sorry for the noob question but what are the {X} nodes that combine vector and axis values?

@Ninjatunes These are multiplication nodes. You can find them by right clicking in the Event Graph and pressing the “*” (star key) on your keyboard. They appear as float * float or float * vector.

Thanks @vr_marco !!

let me jump in and revive once again this thread. it’s simple yet fantastic, I’ve been trying to add this for a while now and just managed to do so after finding this thread. kudos

so I was coding this and debugging sitting on my couch and I was like 2 or 3 meters away from the sensors, and noticed a weird behavior (feature I suppose), when rotating (using the add actor world rotation) I was rotating around an axis in my front, not around myself. that was because I was far from the sensors, and I suppose moving the hmd back only offsets it’s position from the VR origin, doesn’t actually move the pawn.

is there a way to make it rotate around itself instead of the origin? i tried setting the target to my camera but it didn’t do anything. here’s my code:

hey @vr_marco I’ve seen your videos and they are awesome, however I don’t think I ever found a mention of a similar issue as I mentioned above, perhaps people don’t usually get far from their sensors? do you have any idea how to prevent this?