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