- Home /
VR hands in floor when built,Oculus hands in wrong position when built
Hello. I have recently tried to make a game using the Oculus XR package on my Quest 2. This was my first attempt at a VR game, and I used Unity's VR template. The game works perfectly when being played in the editor using Oculus Link. However, when I build the game to the Quest, the hands are far below where they should be, ending up in the floor unless I stretch my arms. I have tried lots of things, all of my packages are up to date, but nothing seems to work. Please help me.
What happens if you do a recentering after starting the game on the device (long-press oculus button)? And does it affect only the hands or the camera as well?
Answer by Chimer0s · Jan 15 at 02:41 PM
@Eggmogo I just encountered this issue and then found the solution.
The XRRig prefab comes in with a component called "Camera Offset" on it by default. This is likely on the rig itself, but may be on the "Camera Offset" game object in the hierarchy. To correct the issue, set the "Camera Y Offset" to 0 and change the "Requested Tracking Mode" to "Floor."
It's working perfectly for me now. Hope this helps anyone else who runs into this issue!
@Chimer0s Thank you so much. You have singlehandedly saved my entire project. You have my everlasting gratitude.
Answer by rh_galaxy · Jan 08 at 06:55 AM
Try recalibrating the floor level and play area, or have the user recenter every startup (long press oculus button), or recentering automatically (by calculating an offset) at startup (but you are not supposed to do that). My game is a seated or standing game, not roomscale. The center position and height will vary with where the user is and the rotation around Y. Position and Rotation Y will be reset by a recentering action.
This is how you can do recentering from code, but I found that it doesn't work for me on the Quest.
UnityEngine.XR.InputDevice headDevice =
InputDevices.GetDeviceAtXRNode(XRNode.Head);
headDevice.subsystem.TrySetTrackingOriginMode(
TrackingOriginModeFlags.Device);
headDevice.subsystem.TryRecenter();
You can also try starting a new project and just add a camera, and a tracked pose driver (like in the picture in earlier comment) and a floor, and see how that goes. Also you should always place the camera in another container object, and move the container when you want to move the camera, because moving the camera by setting the transform will not work as it will be overwritten by the system.
Answer by Eggmogo · Jan 08 at 02:39 AM
@rh_galaxy Nothing happens to the hands, only the camera is affected.
I don't use "Unity's VR template" and just add a "Tracked Pose Driver" to the camera. It works on both quest and pc. Using Unity 2021.1.6f1.
But it sounds like a recentering issue.
@rh_galaxy Assu$$anonymous$$g it is a recentering issue, how would you go about fixing it? Also, I should probably mention that I’ve loaded it over 10 times with over 10 builds, same result every time.
Your answer
Follow this Question
Related Questions
GearVR rotation stutter InputTracking.GetNodeStates 1 Answer
Assertion failed error when using Oculus headset 0 Answers
Why can't I use the latest version of Unity for Oculus VR? 0 Answers
Movement with Oculus Go 0 Answers
Why some scenes on Oculus Quest crash upon adding avatar and some work fine? 0 Answers