I have a simple scene with the XR Rig from the XR Interaction toolkit placed in the middle of it.
When I play/stream to a meta quest 3 through the headset, I am in the correct position as expected.
However when I build this to the headset, I never spawn in the right place. There is always an offset. I think it is likely due to the standing room boundary that you set up on the headset. It must have influence over positioning in Unity.
Any suggestions? I have tried making a script to teleport me to a location at the start of the game, and whilst this ‘activates’, it still doesn’t move me to where I want. The script works through the editor though, if I move the rig then press play it’ll go to the correct position.
I don’t think the version of Unity matters, but since the rig prefabs may be different in xr interaction toolkit plugin, maybe there is something I can do to the rig? Maybe there is automatic recentering going on?
This is due to the OpenXR spec only supporting stage and device-based tracking modes by default.
In newer versions of the OpenXR package in Unity, we added support for local floor based tracking and have a fallback mode that simulates it. The fall back mode supports recentering, but doesn’t recenter until the user does by manually holding the meta button on the right controller.
Local floor is an openxr extension that behaves the way you want but it requires the runtime to implement it. It’s a part of OpenXR 1.1 so this will happen at some point soon, but it is not yet rolled out widely.
I am using Unity 6 so have OpenXR 1.1 - are you saying the behaviour I want is already in this version?
Or are you saying right now, I will need to hold the meta button to recenter for now.
If you could break down your points further that would be great, as I am not too experienced yet with VR design
I tried using the meta button, but all that seems to do is recenter my forward view rather than put me where I need to be in the scene.
to clarify, what I need is that whatever the room setup turns out to be, no matter where you stand in the room you should launch the app and spawn in the same place each time, and then you can move freely
You’re using the openxr package version 1.11. What I’m saying is the behaviour you want is called local floor origin, and it’s a part of the OpenXR spec version 1.1, which runtimes have to adopt. Meta will likely ship a firmware update in the near future that will support this, but we don’t know when that will be.
If the local floor origin approximation is not working for you, you have a few options.
Switch to device based tracking. This loses the ability to map the floor height, and instead centers the origin on the camera position + an offset defined in the rig.
Wait for meta to ship support for the local floor extension that’s part of the openxr 1.1 spec.
Switch to the oculus XR plugin skip openxr for now. If you do this some poses will need to be changed. (Controllers have a 5 cm offset on the models compared to openxr).
oh I see, you’re essentially saying that currently Meta Quests do not support OpenXR 1.11 yet and therefore even though I do technically have the functionality there in the project, the MQs won’t recognise it yet. This seems surprising to me though that the behaviour I am describing is still yet to be supported. Is what I want not typical game practice? What do games normally use?
Right now, on the rig I have a Tracking Origin Mode option, which gives me the options ‘not specified’, ‘device’, or ‘floor’. The only offset I can add for ‘device’ is the camera height. Trying this option still doesn’t spawn me in the right place though. I hoped using a script to just teleport me on scene load would work as well but as said in the original post, it doesn’t work.
would you recommend using OculusXR instead of OpenXR anyway for meta quest development?
Hmm if the device based tracking is not centered properly there must be some other offset getting in the way.
I would try redoing your room setup and setting up your boundary correctly. If that doesn’t solve it, try grabbing the vr template in Unity 2022.3 or Unity 6, and see if the same issue occurs there.
Generally I’d recommend openxr over oculus XR as it’s the future and supports everything built into Unity much more natively. The origin management remains a bit problematic with OpenXR for now, as the runtimes are slow to adopt the new standards.
using ‘Device’ based tracking seems to work now, in the sense that I map out the room, then hold the reset button to recenter. When I launch the game, it seems fine now, and I can relocate IRL and reset, and it positions me correctly (so it always resets to whatever the XR rig’s initial position was). So this seems to be okay now.
Thanks for the help and suggestions. Is the difference between device based tracking and the yet-to-be-supported local floor based tracking is that with the latter, you would not need to manually reset orientation, and you would always spawn in the correct place if you move around and relaunch?