cancel
Showing results for 
Search instead for 
Did you mean: 

How To Implement An "swinging arm" or "running in place" Locomotion System

dovsherman
Protege

Hi, I want to use UE4 to build a “jogging in place” locomotion system. Could anyone please let me know where to start learning how to do this? There is a "swinging arm" locomotion blueprint example provided in the ue4 oculus fork. I was thinking of using that to expand on, but I can't find the actual source code, so I don't know how they implemented it. Mainly, how did they deal with capuring the pysical motions of the controller/hmd, such as accelleration?

 

I’m very familiar with coding; and I bought a few ue4 c++ courses on Udemy that were geared towards VR development such as the following: https://www.udemy.com/course/unrealvr/

 

But all of these tutorials simply demonstrate how to implement a teleportation system and nothing else. Could someone provide me with some insight on how to implement this system in ue4?

Thanks.

9 REPLIES 9

MaxArch
Heroic Explorer

I tried this once in Blueprint. On tick track the difference in position of the motion controllers and convert that distance to an impulse in the first person char blueprint. If I remember well, I created some sort of energy 'bar' that the movement-impulse was added into and that the movement was maxed out at some value. When stopping moving your arms, the energy would drain the bar and you would stop after a few steps.

Problem with just tracking the delta-movement was that it didn't matter in which way your arms would swing as long as there was a delta movement. Surely will be a better way to do this

Hi MaxArch, I get what you're saying with the energy bar and I would like to build on that idea. But I would also like to integrate head movement into my implementation alongside the controller (or hand tracking) movement.  How do people usually go about doing this? Like, is there some kind of API that is used to get the controller and headset's acceleration and pitch? I'll probably be implementing my solution in C++ since I haven't been using ue for long enough to get comfortable with blueprints yet (although if I can get the same results and it's easier I might as well use blueprints).

MaxArch
Heroic Explorer

Maybe have a look at the Oculus Examples on Github (you need to make a github account). You'll find a locomotion example project with all kinds of locomotion options - also one with swinging arms. The same principle can be applied to head movement I guess.

See here: https://github.com/Oculus-VR/UnrealEngine/tree/4.27/Samples/Oculus

You'll find a video describing the examples here https://www.youtube.com/watch?v=j9aqZIF5cDc&t=11s

 

dovsherman
Protege

Thanks. Do you know if there are c++ implementations for the arm swinging locomotion sample? I only see blueprints.

Sorry, cant help you there. Why not try doing it in blueprints - for prototyping its great.

Eanir
Protege

Check the VR Expansion plugin's implementation:

https://vreue4.com/

Dingenonma
Protege

I am also very interested on this... But didn't find any clear tutorial or info out there. Any clues? Thanks!

 

I ended up working on a version in UE5.x a year ago. There are many ways to implement it but to make it feel "natural-ish", consider looking into inverse kinematics.

That's great to know...

Can you guide me a bit? Or show me some of your logic?

Thanks!