OpenXR Mixed Reality teleport target offset if person has moved

Forgive me for being hazy on the details, but it was years ago since I set this up:

I have a camera in my pawn which tracks the VR headset (HP Reverb/G2) and I teleport the pawn around using this:

The problem is that if the person in the headset has moved physically in the room, the location they end up at is offset from the target location by seemingly the same distance…

Anyone have encountered this and have a solution?

The code applies the local space offset of the camera to the world space actor coordinates. If the player pawn is rotated, the coordinate system directions will not match anymore. The VR template has an example on how to apply the pawn rotation onto the coordinates.

2 Likes

I did not consider rotation because I do not rotate my pawn in any way…

except, it turns out, when it’s placed in the level. That’s where the rotation was hiding and indeed what messed it up!

Thank you for pointing me in the right direction. I’m probably going to adapt the rotation from the template because it’s quite convenient.

That’s why it’s part of the template :slight_smile: Good luck!