HMD + Character Collision

How do I create a VR character where collision follows the HMD?

I’m working on an architectural visualization project in VR, and the main issue I’m having is that if the player physically moves sideways, the collision volume gets too far from the camera.

What’s the right approach? I’ve considered the following, but neither seem possible with a Character blueprint:

  • Use a non-root component as the character’s collision volume? (so I can make it a child of the camera component)
  • Lock the root collision component to the HMD position instead of the camera?

In order to have a collision follow the camera you need to attach it to the camera. The only problem is that if you do you will end up with the thing rotation all over the place. You probably instead wants to simply update the location only every tick. That way you can look down or up without the collision box hitting everything around you.

You could also attach it and then reset the rotation every tick. It is up to you.

Thank you for your help. I’m still missing some key details to make this work:

  1. If I have the collision capsule follow the camera it is no longer a root component, so the Character doesn’t factor it into movement.
  2. If instead I have the camera attached to the collision capsule, then updating the collision capsule also updates the camera position. If I move the collision capsule to the old world position of the camera, then my entire Character starts flying off away from its starting point. What’s the right way to work around this?

@NoobsDeSroobs Added a clarifying comment with my difficulty making these approaches work.

In vr the pawn does not really exist. What you are moving around is not the pawn as you would think of it with a normal game, but instead it is the playspace that you move. That is why if you attach a collision box to the pawn it will stay stuck at the center of your playspace.

If you are making a sitting down game where you use a controller or mouse and keyboard to control the player character around, then I agree that having a collision box that is attached to the camera will not work. However, you did not ask for that in your question, only how to make it follow your camera. As it seems now you have two collision boxes that you want to use.

For your second point, yes. That will naturally occur. I never said you should do BOTH. Either have one that is attached or one that is not attached that you teleport around.

What VR system are you using? What input methods? Is it standing or seated? What do you do to cause the problem? What exactly is the problem?

Of course I’m not trying to do both. The VR system I’m using is Oculus Rift, though I’m also targeting the Vive.

The input method is a simple bluetooth remote, which when pressed, adds movement input in the direction that the user is facing. It’s a standing experience.

The current thing I’m trying is to, on each tick, call a function to move the collision to match the camera (

) but this unfortunately causes the Character to no longer update its position from the CharacterMovementComponent.