I have a situation in my game where the player changes pawns, the goal when returning to the original pawn is to be in the exact same position before the switch, but if the player moved in his playspace the position is not the same upon returning because it’s moving the camera to the new HMD position, I’m using 4.27.2 and Reset Orientation and Position doesn’t work, is there another solution for this?
You would have to store the world-space transformation of the camera component when switching out. When returning, compose the current world-space camera transform with the inverse of the original one. Then add that to the transform of the player pawn.
That seems to work pretty well the only issue is that I have to wait a for a frame after possessing to get the new pawn position so I can calculate how much I moved and this single frame translation can potentially trigger stuff in the game, is there a way to check how much the HMD moved instead? I can’t seem to figure out how to get this info
For now I think I’ll just disable all my colliders and stuff while I move the player back to it’s original spot to prevent anything weird happening during the translation, wish I could just reset the HMD position to what it was and not have to move my pawn
The camera component is always posed where the HMD is relative to the tracking space in its local space, so you could probably use the local pose of it instead.