Attach Pawn to HMD?

Hello! I’ll just get right into it.

I’m working on a little VR project that has no user input in terms of controller or keyboard but just an oculus dk2. So far I have had great results and managed to figure out a lot on my own. That said, it would be great if someone could help me understand the unreal terminology / design for what I believe I would like to do. The problem i am trying to solve is to get unreal to understand the position of the hmd and have that effect the same things that moving a character does. For instance I managed to figure out on my own that by grabing the HMD position and setting the listener audio location I could have the hmd location drive a sound change as the user passed from one sound attenuated volume to another. I would like to do this with a post process volume as well but am not sure how to go about that.

Any help would be greatly apprecaited! thank you!

From what I understand, you are trying to do something similar to what I was asking [here][1]. The basic idea of the solution I came up with is to move the character on each tick towards the camera (or rather, a scene marker that is attached to the camera that is approximately where my neck is) and then update the VR origin scene component to keep the camera stationary. It’s a bit tricky to set up, but works well.

Here is how I’m moving the character:

It is important to update the VR origin immediately after movement and before rendering, or you will get a lot of nauseating shaking. To do this I’ve bound a function to OnCharacterMovementUpdated like this:

UpdateSceneOffset looks like this:

For thumbstick movement, I’m just moving the VR origin in the direction I want to move. I’m basically just adding a vector to the world position of the scene, then clamping it within ~30 cm (this is an arbitrary number but it needs to be greater than 0) of the location that would cause the camera to always be stuck to the capsule. This prevents you from walking through walls. This vector is calculated like this:

And then moved like this, accounting for rotation because MoveComponentTo uses relative locations and physics sometimes causes the character to rotate and we don’t want the camera to be affected:

I’m using MoveComponentTo because simply updating the location causes choppiness. Speed is controlled by a scalar applied to the thumbstick and (more critically) the delta on MoveComponentTo.

Note that I’m using a vive and you may have to make some changes because oculus. I hope this helps get you where you’re trying to be. Feel free to ask questions if anything is unclear.