Skip to main content
Up and Coming
March 22, 2022

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

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.

This topic has been closed for replies.

9 replies

MaxArch
Inspiring
March 24, 2022

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

Up and Coming
August 22, 2022

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
Inspiring
August 23, 2022

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

 

Up and Coming
August 25, 2022

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

MaxArch
Inspiring
August 25, 2022

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

Up and Coming
October 21, 2022

Check the VR Expansion plugin's implementation:

https://vreue4.com/

Inspiring
April 5, 2024

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

 

New Participant
April 5, 2024

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.

Inspiring
April 8, 2024

That's great to know...

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

Thanks!