# OpenXR Mixed Reality teleport target offset if person has moved

**URL:** <https://forums.unrealengine.com/t/openxr-mixed-reality-teleport-target-offset-if-person-has-moved/695904>\
**Category:** XR Development\
**Tags:** Mixed-Reality, Windows-Mixed-Reality, unreal-engine\
**Created:** [November 21, 2022, 1:48pm UTC](https://forums.unrealengine.com/t/openxr-mixed-reality-teleport-target-offset-if-person-has-moved/695904 "2022-11-21T13:48:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![roberteker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@roberteker](https://forums.unrealengine.com/u/roberteker)\
**Post date:** [November 21, 2022, 1:48pm UTC](https://forums.unrealengine.com/t/openxr-mixed-reality-teleport-target-offset-if-person-has-moved/695904/1 "2022-11-21T13:48:28Z")

</div>

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:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/d/3/0d3d4b6a03de0e3f81ebbdbc80bdb5aded45a059.png)

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?

---

<div class="post-metadata">

**Author:** ![Rectus\_SA](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rectus\_SA](https://forums.unrealengine.com/u/Rectus_SA)\
**Post date:** [November 21, 2022, 2:39pm UTC](https://forums.unrealengine.com/t/openxr-mixed-reality-teleport-target-offset-if-person-has-moved/695904/2 "2022-11-21T14:39:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![roberteker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@roberteker](https://forums.unrealengine.com/u/roberteker)\
**Post date:** [November 22, 2022, 1:18pm UTC](https://forums.unrealengine.com/t/openxr-mixed-reality-teleport-target-offset-if-person-has-moved/695904/3 "2022-11-22T13:18:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![VictorLerp](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/victorlerp/32/738381_2.png) [@VictorLerp](https://forums.unrealengine.com/u/VictorLerp)\
**Post date:** [November 22, 2022, 7:50pm UTC](https://forums.unrealengine.com/t/openxr-mixed-reality-teleport-target-offset-if-person-has-moved/695904/4 "2022-11-22T19:50:40Z")

</div>

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