Download

Collisions in VR and movement

A big problem with UE4 VRLocomotion besides the obvious simsickness issues, are that there’s currently no native/simple way of having a collision capsule. Yes there’s Mordentrals VRExpansion plugin, but if you’re like me, and don’t like relying on plugins, and also don’t do c++, then you’re **** out of luck, because it’s actually fairly complicated stuff to get something as seemingly basic as a VR collision capsule. I’ve explored a number of options lately.

  1. trying to build my own based off of a Pawn. This works ok, but has a major draw back, that it don’t use all the neat MovementComponent stuff that the Character class has. It also doesn’t support replication, since i rely on the capsule simulating physics in order to collide with stuff.

  2. trying to build a setup around the Character class. I got this to work using a Pawn and a Character. Couldn’t get it to work with only a Character. It has some issues with counter-movement precision, that are hard to notice, but it’s still there. This causes the Chaperone to move around ever so slightly.

  3. re-implementing or modifying the Character/MovementComponent classes functionality in c++. I had to give up on that, because my c++ skills are simply too poor.

So you might ask, why make it so complicated? Well i’ve seen quite a few games/vr experiences where collisions are just skipped over. I find that highly immersionbreaking, when you can walk through things and don’t collide with the world. So what kind of requirements for collisions am i talking about?
a) Allow vr locomotion (also refeered to as world movement)
b) Allow roomscale movement (with ie. Vive, moving around in your real world)
c) Get collisions from a) and b) so you can’t end up cheating through walls
d) Allow leaning over things (for ie. grabbing an item in the middle of a table. Since the table should have collision, the capsule should block movement for passing right through it, but still allow you to lean over it in roomscale. And also allow you to stand on top of it
e) Allow moving smoothly in the z-axis (stairs, slopes)
f) Allow following moving surfaces (imagine standing on a moving platform, your capsule should obv. follow that)
g) Allow crouching under things in roomscale, in order to get to areas that in the vr-world require you to crouch (or be smaller)
h) Keep collision with your head, so you can’t stick head into walls or meshes/items

So a small analysis of the requirements i have (There will likely be more).
a), b) and c) can be solved by the capsule colliding with the world. It will cause a push back feeling, if you walk towards a wall in roomscale, since the collision prevents you from moving forward. While this does work fine, gameplay-wise, it does feel a bit weird. So another way of solving this would be to allow walking through the wall, but only for a certain distance or time. Once this is passed, you will be teleported back to your actual capsule location. This partially handles d) also, since you can allow disconnection between your camera (hmd) and capsule. This is also the approach i took for my own attempt at implementing a capsule logic. However this approach suffers from above mentioned shortcommings (using physics, thus behaves weird sometimes, does not replicate well and require all special cases to be implemented manually by you).
e) is maybe another of those seemingly simple features to have, but since you can move around in roomscale too, it becomes a bit more complicated. Moving on steps are also a bit more difficult that first anticipated. Since it can cause a lot of simsickness, due to the sudden level changes. It is however quite individual it seems. Some actually prefer the instant step jumps while others prefer a smoothed out movement.

g) Also there’s the height to factor in. People have different sizes and some may not fit into places where others do, without crouching. We can assume your head is defining your height + maybe a bit of an offset, because the tracking point of the hmd is about the eye level height. If you lie down flat on your stumach your capsule also need to be adjusted in height, so it doesn’t get pushed through the ground.

h) To me it’s gamebreaking to be able to wall-peek. So either handling it by doing pushback or toning down visibility somehow are two of the most obvious solutions for that. Pushback can feel weird while shutting down vision can also feel really unpleasent. With a max time to keep vision shut down (fade to black), you can get rid of some of that, and also introducing a bit of a fade time can make it better. Also adding in a reference view (outline of a kind) can help your player to find his way out, in case it was a mistake). Automatic teleport out of a wall, can help, but won’t necessarely help if you moved into an area u had to crouch under, and suddenly stand up. Where would you teleport to? So in that sense, pushback is actually much simpler, all though i don’t prefer it personally.

I’ve made some experimentations myself on my youtube channel. You can hear me talk about the solution i went with (1). But i want to warn you, that this has quite a number of shortcommings as mentioned above.

https://youtube.com/watch?v=DuoQwz_yUoo

But i want to encourage Epic Games to also read this and see if they can see the reasoning behind this post and hope they will consider adding support for this in the future. Also i hope others will pitch in with ideas and solutions to this. I do realize we have different requirements, but lets have a talk about this.

Still hope either one from Epic can say if there are plans to make this native or someone that has managed to solve it all in an easy accsible way for us mortal BP-people.

Have you tried the OpenVR expansion plugin? It handles collisions perfectly…

Great points! Eliminating wall peaking would help almost everyone working in VR so native support would be quite useful. Do we know any of the UE4 plans going forward for VR? Mordentral’s OpenVR expansion plugin is great however, plugins and c++ are not ideal for some of us “mortal BP-people”

Very interesting thread, really Epic bet for ghost and teleport VR room scaled (at least that is my impression, First Person Template is not a valid option for the limited/fixed CapsulleCollision in the center of the chaperone). Collision should be a important part in this scope and axis displacement a inherit way and choice.

Glad to see others dealing with same issues as i am. And if you’re doing BP only (as i am), you’re really in a bad place.

I can say that i decided to see if i could hack together some workaround in BP only, which i will hopefully be able to show in a week or two, but it’s still not optimal to have to do that much work to get this to work. I’ll see if i can remember to update this thread when i put a few videos online on my channel with my preliminary findings/results.

Well, sad i didn’t know this before. I bought book especially for the unreal engine 4. Will using unity a better option for me? I need ‘Locomotion’, ‘jumping’ and ‘hand collsion’.

Hey everyone, I’m a 19 yrs old noob but i wrote this code and it works fine on my oculus quest, it’s all in a character blueprint and i can do all the things that Jonas_Molgaard listed. My question is if I did something i’m not supposed to do cause i read everywhere that it is super hard to do in blueprints (took me 2 days :P).
Greetings
Kenneth

ps: sorry for bad english

Hi there Lolboer,

You’ve resurrected a rather old thread. I’d recommend making a new post for this issue, as it may be confusing to see the above posts regarding the state of VR in UE4 as it was in 2017.