VRPawn collision detection with floor and walls?

I am not sure how to handle collision detection with the floor, to support areas with slopes, stairs, cliffs, etc. If the player walks forward on a sloped area, such as stairs, I want the pawn to move up and down accordingly. Similarly if they step off a cliff, they should fall down, instead of hovering in mid-air. Any suggestions on how to accomplish this?

I also want the solution to be able to support collision with walls – if the player tries to walk through a wall, the virtual space will move accordingly to prevent them from penetrating the virtual wall.

Is there a standard way to accomplish these tasks?

Well I have a plugin that supports all of that already…

Other than that you would have to do a lot of work yourself making the systems work.

The plugin

I am looking for this too… is there a way I can add this plugin to my project? I am already pretty deep into my project and just need wall/slope collision

I just want collision :frowning:
:stuck_out_tongue:

Thanks in advance.

Entirely depends on how you have your pawn set up. If it is a character you would just have to change the parent.

I’m using the motioncontrollerpawn from the VR template in 4.13. and I’m using the floating pawn movement component. I have added a capsule to the root for collision which knocks physics actors out of the way but doesn’t stop me from going through a wall. also I’m using my left thumb track pad as a thumb stick output to generate the movement much like the game “Onward”

so here are screen grabs of my player pawn. using “FloatingPawnMovement” does anyone have any hints or ways to have my character act like a normal first person character with gravity?

as you can see im using the left thumbstick to move forward but I seem to go right through collision and am floating. cant seem to get gravity to work :frowning:

any help would be greatly appreciated!


My opinion is that VR is a different beast from regular 3D game movement, and this kind of thinking leads to VR nausea.
The way that research shows us we can move in current VR is to move a box around the environment; this box represents the play floor (for room-scale VR.)
Do not allow the box to intersect any geometry, and do not allow it to protrude over any unsupported space. Doing so just creates immersion breaks and VR motion sickness.

I understand that but games like “Onward” have proven to show that lots of people dont get motion sickness as long as you dont “ramp” up and down the speed of movement . I have tested out moving like this in my game and dont get sick but using what I have now I can only move on a plane rather then up and down and all around :). I appreciate the info but my target is to have my character act like a normal first person character.

Jwatte, you keep posting this over and over in places and it begs the question, have you actually tried full 3 degree’s of freedom linear movement in VR? When done right it is no-where near as bad as those DK1/2 fps mod days with low persistence and high latency (back when the “studies” were all mostly done). There are also ways to alleviate sickness during movement that work pretty well and can help out people between the two extremes.

The general opinion is shifting pretty heavily over to keeping teleportation and methods of movement like you describe for the players that have major issues with nausea that they cannot eventually kick, but having more free movement options for everyone else.

I personally lost all sense of movement induced nausea after creating a free movement system and I can’t go back to teleport / marching floor movement without feeling limited now. I understand why having the safer movement systems as backups for people that just can’t kick the sickness (my wife is one of them), but there is really no reason to limit things just because “best practices” were introduced back in the DK1 days.

Not to mention just how much it opens up the game play possibilities to have free movement, we wouldn’t be dealing with all of these wave shooters and static experiences if more developers felt like it was possible to create a game that had more world interaction.

There isn’t a “fix” for turning roomscale into fully walking experiences, re-directed walking and worldspace perspective bending will never allow for full freedom of movement in any size play space. Developers are going to have to think and work outside of the proverbial box eventually or VR is going to get really really stale.

@mordentral I totally agree, we have to get creative with new with movement and different was of using VR and nice post!

but… back to the original problem of this thread.:stuck_out_tongue:
Does anyone have any ideas of how to get this pawn moving like a “regular” pawn.
I opened up the First Person template and it seems to be able to use a CharacterMovement component but in my motioncontrollerpawn from the VR template of 4.13 I dont seem to be able to add that component, does anyone have any clue for a work around for this?

you would be my savior!!!

Thanks in advanced:)

I already answered that I think, you either need to make a dummy character that you track your vr characters location to which has some downsides but still “technically” works, or you could use my plugin character.

You can’t add a character movement component to a pawn, only to a character as it depends on some of the properties of a character. You could add a floating movement component and fake gravity with it and raytrace for the ground / walls if you reaallllly didn’t want to change your current pawn up but I wouldn’t suggest it as a final solution.

When I say “studies,” I refer to actual research tracing a line all the way back to the '80s… They had the frame rates back then, and they did the image warping using heavy, expensive lenses rather than shaders, but the surface rendition was of course quite primitive!

Note that I just recommend you move the box around; if you can ghost-fly a box (and, especially, if there is something fixed to keep you grounded, such as a 'mech cockpit or whatever) then that’s fine. Just that you should stop allowing the center to shift once the box would enter a non-allowable area. Then you can take advantage of the room scale walking experience within the 7x7 foot area such players have.
Also, again: Just because you may prefer a certain environment, doesn’t mean that general players will prefer that. If you target yourself, that’s fine, as long as you know that you’re significantly limiting your potential target market. Because the area of real consumer VR is so new, you really have to do actual studies yourself, or read up on the research, to figure out what the distribution of acceptable solutions are, and how it overlaps with your target. Designing for a target market of 1 is really easy! :slight_smile:

@mordentral alright you have sold me! I will use your plugin Character and try to move/migrate/copy my logic and other game stuff over

do you have any good tutorials of how to get your character up and running? I have never really messed with plugins.

also if I use your plugin can I use all multiplayer stuff too?

again thanks for your help

@mordentral or if you could explain this a little more, what ever you think is easier. I am not very good with C++ I am using blueprint

The 80’s/90’s research was on high latency low resolution hardware without frame smoothing and under 90 fps, it was nothing like today…

I am also not just targeting myself here, there is a lot of community support for more interactive movement right now, as well as a few large studios switching over to freewalk / teleport options for the players. I’ve been freelancing for a company that is supporting 4 different movement systems in their upcoming game so that players have the options they want and can pick and choose what feels best to them, it is also open world, which wouldn’t suite a box bounded movement considering that it has forests.

Even fade to black with obstacles is in my mind a more playable experience than forcing players outside of actual interaction with the boundries of their enviroment.

Consumer experience is the real test of viability right now and I see a lot of old studies from old hardware conflicting with the desires of the actual consumer base for the technology. As a non AAA entity myself I don’t see the need to “play it safe” and limit anything for my personal projects and I also don’t see a need to tell others that they shouldn’t be attempting to come up with new ways of doing things.

I wasn’t pushing my Plugin btw, you could get it working with the duplicate pawn method or manually, I just said it was also an option.

It has a wiki going over each component for it, i’ve tried to retain the standard engine workflow as much as possible and it is built to be multiplayer compatible out of the box, basically you use the character and go from there. I do suggest turning off player capsule collision with everything but World_Static to begin with as it will make things easier laying out levels with objects you want to pass through instead of be blocked by.

For the duplicate pawn method, some people have been spawning a full character, mirroring the movements of the HMD and then backing players pawn back after the dummy character moves to simulate gravity/collision with objects. Its workable, it just has extra overhead and is harder to juggle.

There is a preview video of the demo here (video has demo download link), might help you decide if you want the plugin or the dummy character: https://www.youtube.com/watch?v=tKS_50LiamI

I will warn you that the demo is intended to be an extreme example, the terrain is not flat and there are cliffs so it intentionally introduces things that are normally avoided.

Oh I know that! your plugin look great! I was just being lazy and didnt want to have to transfer some logic but your plugin seems very powerful! so I think im going to go with that! plus the multiplayer is a huge plus! lol :stuck_out_tongue:

Do you have any advice or tutorials on how to properly get your plugin up and running in 4.13?
is there a blank project that I can download?

excited to get it up and running!

Thanks again man!
really helpful!

Sorry my test project still has a bunch of random stuff attached to it. Basically though make your default character a blueprint character with the VRCharacter as its parent. Then add movement like you would a normal pawn but driven off of the motion controller buttons instead. The character comes with everything already attached and ready, you just have to add meshs to the controllers and change any variables that you want different. The only real caveat is that for forward vector when doing movement you’ll want to use the one from the VRRootComponent->VRForwardVector, not from the Character itself as that one doesn’t follow the HMD.

I do also suggest adding in a -8 X offset to the VRRootComponent in its offset property, this re-positions the capsule closer to the players neck instead of at the front of the HMD (where the tracking is done).

You don’t have to use any of the gripping features of the motion controllers, you can keep using the templates set up if you want, just don’t call the functions.

@mordentral w00t w00t!
I got your plugin and made a VRcharacter. the movement works just how I needed it to! Thank you so much for all the help! one last thing. I noticed that the motion-controllers seem to be code but I am better with blueprint. for now I have attached mesh to them in construction script of my VRcharacter (so I can see them) and have been doing most of my logic inside my VRcharacter. but is there a way to convert the motioncontrollers into a blueprint so I can add overlap sphere, mesh, and what not, so that I can easily pick up stuff? or is there pick up functionality build into the code? anyways as of now im keeping most of my logic for my “hands( motion controllers)” inside the VRcharacter and getting overlap events from the mesh components i have attached to the motion controllers on construction rather then the actors themselves. is this ok or not recommended ?

again thanks and super cool plugin. got me the movement i needed!
I owe you one! :slight_smile:

The motion controllers can be used in blueprint just like normal ones, the difference between mine and the engine ones are that they replicate over the network by themselves and they have a bunch of built in grip functions. You don’t have to use the grip functions if you don’t want to but they offer additional features over what is possible in blueprint. I wouldn’t attach additional controllers on construction, I would just use the ones already attached to the character and modify scripts that you are using for them. I realize that epic uses seperate blueprints for thiers and handles the pickup functionality within those but since the grip functions are built into my controllers I just add overlap spheres or run traces directly from within the character itself.

Scripts need to reference GripMotionControllers instead of MotionControllers as I was unable to get all of the features in just deriving from the standard motion controllers and ended up having to re implement them entirely.

Interfacing with the GripMotionControllers is all done with blueprint though, the plugin isn’t intended to be used with code only (although it is possible).

You can feel free to set the default controllers to not Tick and hide them and use epics blueprint versions if you wish though, it doesn’t hurt anything. I will mention that the built in functions support world interacting grips and two handed interaction with objects and that may save you some time depending on what your plans are.

I already agreed that resolution was low. However, that research drove frame rates high and latency low – the research from the early days is what taught us that, and made the current crop of consumer devices target 90+ FPS.