Static mesh parented under camera for Rift?

There are times when I would like to display a static mesh billboarded in front of the camera. In my pawn where the camera component is defined, I have a static mesh parented underneath the camera.

This displays just fine in normal play, but when the Rift is enabled, the mesh is no where to be seen.

So my question: does that camera component actually get replaced with another when the oculus is enabled? Is there any way to preserve the hierarchy under the camera?

Thanks!

try to activate the “follow hmd orientation” checkmark in the properties of your camera manager (or player controller… forgot which one it was). does that help?

Thanks for the reply! Hmm - I’m not sure I fully understand what “follow hmd orientation” really does. Here’s why:

First, I enabled it as you suggest, and magically a different issue I was seeing that the view would be facing the wrong direction when using the rift was solved. (Found another thread talking about it here.)](VR mode, custom pawn, view is 180... in rift mode only - XR Development - Epic Developer Community Forums)

But no luck with my mesh. Then I realized that I’d forgotten to take into account the head offset in rift mode. I pushed the static mesh out a bit, and suddenly I could see it in rift as I wanted.

Here’s the part I’m confused about: with “follow hmd orientation” checked, the mesh would not move around with the camera movement. With it off, it would follow as I wanted, but then I get the other bug of starting out facing the wrong direction in rift.

Does any of that make sense to anyone?

Thanks!

By enabling follow HMD orientation, the HMD orientation is added to the player camera manager instead of the player controller. It will do nothing to help you show/hide a static mesh for one particular eye.

To ensure it always follows the camera, attach to your character camera component, then offset it.
Alternatively, update the static mesh transform every tick from your camera.
I’ve do this with a static mesh plane for rendering the output of a Coherent UI based menu.

To do this properly, you would really need to edit the source.
Otherwise, offsetting it based on the head offset and IPD is the best you can do.

Great, thanks for the response, that makes sense.

Hi!
Is there any way to interpolate the movement, so it has a delay until it reaches the center instead of being fixed?
Thanks!

Hi!
Is there any way to interpolate the movement, so it has a delay until it reaches the center instead of being fixed?
Thanks!
[/QUOTE]

This is what you are looking for. The vector being rotated is the offset of the static mesh to the Player Pawn in this instance. I then add the z value (height) after rotating the vector. I also add a little yaw offset to skew the mesh towards the camera view. You are going to need to use the offset values that work best for your project. Changing the Interp speed of the VInterp and RInterp will speed up or slow down the delay.

What I can’t figure out is how do you get the world or relative location of the HMD view camera? Getting the transform for the camera manager works normally but not while in HMD mode… Currently I have everything rotating around the root of the player pawn which causes the vector rotation to be off a little when pitching. To fix it, I need to the world or relative location of the HMD view camera…

I should note that I am not using a camera component… The project I am working on already had the camera specified in C++ and not setup as a component in the editor… I’ll probably just have to change that…