I’m working on a VR project in UE5.3 and have encountered a bit of a puzzle regarding HMD tracking and its integration with a MetaHuman character.
In the default VRPawn, there’s a camera with a GenericHMD mesh as a child component. I’ve noticed that this GenericHMD mesh accurately moves in sync with the physical HMD’s movements in the VR space. I’m trying to understand the underlying mechanism: How exactly does the physical HMD inform the Camera component of its location and orientation in the Unreal Engine?
This functionality clearly works well with the GenericHMD mesh, but my attempts to replicate this with Get HMD Orientation and Position nodes in my Blueprint have been unsuccessful. It seems like I’m not getting the correct data, or perhaps I’m missing a step in the process.
My ultimate goal is to have a MetaHuman character’s head move in correspondence with the HMD movements, creating a more immersive VR experience. Any insights into how the GenericHMD mesh is set up to track with the HMD, or advice on how to correctly retrieve and use.
The mesh is just parented to the camera, so it inherits the camera pose. An easy way to get the HMD pose is to read the position and orientation of the camera itself.
@Rectus_SA I will try that once I make it back to my rig, as I do believe that would serve as a more than adequate work around, thank you.
Even if this serves to get me the HMD pose (which I strongly believe it will), I’m still curious as to where exactly the camera gets the HMD data. It isn’t under VRPawns Event Graph (that I could tell).
Anwer: in the VRPawn, since the mesh for GenericHMD is mapped to Camera, and Camera is set to Lock to HMD, the HMD appears to move.
If you want this data, you can use the Camera’s orientation/position or you can use “Get Orientation and Position” set to Event Tick. I’ll include what that looks like in the Event Graph:
Thank you again @Rectus_SA . Your hint about the Lock To HMD helped me to realize that I wouldn’t find it within the BluePrint itself, and that it would be handled on the C++ side of the house. (Yes, you explicitly told me as well, but the burnt hand teaches best).