Hi,
I’m trying to make it so that when the user presses the “A” button on the oculus quest 2 controller.
It triggers this function and resets the camera.
In the attached image, the commented out code is the new and recommended way of doing it and the Uncommented one is the old/obsolete one.
Both methods work like a perfectly when I’m testing in the Unity editor with the Oculus Headset hooked up via Oculus Live link. When I build and run it on the headset, it doesn’t work.
I’m not sure why this is happening. Can anyone help me please?
I have three simple scenes with three different room-scale XRRigs. The scenes can be switched by touching a trigger.
When I switch the scene it seems the VRCameras offset to the center of the XRRig is influencing the spawn position in the next scene. My player never spawns on its intended spawnpoint (the XRRig I placed and orientated). So it happens that my player spawns outside of the walls or he is facing a wall instead of the intended direction.
I did some tests (including InputTracking.Recenter()) and did more research above that but all I found are some SteamVR or OculusOVR related solutions.
Oculus Quest and Quest 2 doesn’t support recentering with code as far as I know, but you can always get around this issue by taking the player offset object under the xr rig and moving it in a way that the player is centered to their rig. This worked for me
This is by design. Re-centering can only be triggered with the current Quest runtime (long pressing oculus button on right touch controller). So it’s expected that XRInputSubsystem.TryRecenter() is a no-op.
@TreyK-47
For some reason it doesn’t work on Rift (PCVR) either for me.
Here’s the code:
var inputSubsystems = new List<XRInputSubsystem>();
SubsystemManager.GetInstances(inputSubsystems);
for (int i = 0; i < inputSubsystems.Count; i++)
{
inputSubsystems[i].TryRecenter();
}