When my Oculus Quest app first launches, the game floor is not being set to the correct height vs. the real world; the game floor is too low. If I reach a controller through the Guardian, the Guardian properly starts at the physical (real world) floor and goes up, and the hmd display aligns with the real world height (using the Guardian as a reference), but in the app, the Guardian is roughly a half meter (varies) above the floor object (at 0,0,0). I get the same offset regardless of if I launch the game sitting or standing. The OVRManager script is set to Quest and the “Tracking Origin Type” is set to Eye Level. The TrackingSpace and all the Anchor transforms are correct [(0,0,0), (0,0,0), (1,1,1)] and a sphere placed at the TrackerAnchor position aligns with my hmd at launch.
What setting do I need to change or how within the app do I initialize the height so the real world height (0 = the bottom edge of the Guardian) matches the game floor (y=0)?
I found the issue has to do with my position the last time I reset the view / recentered the menu. If I was standing up then the Guardian was correct when I launched my app, but if I was sitting down then the Guardian was elevated by distance between my sitting height and my standing height; the same amount the main screen moves up and down.
Is there a way to detect and correct this when the app launches?
I had this issue when using Eye Level.
Eye Level works well for a game that uses a table in the scene, since the viewer’s eyes need to remain “above the table” whether they are standing or sitting when they arrive. AFAIK
However, if I would rather have the physical floor aka guardian floor remain matched to the scene floor, I used Floor Level with a code change. I have an older Oculus integration using a Character Controller of Height 1.5.
Without a code change, using Floor Level, the scene floor appeared 1 meter beneath the guardian floor when my OVRManager’s GameObject’s y value was 1.6 in the Inspector, but dropped to 1.02 with continuous slight variation while in play mode, the TrackingSpace’s y value was 0, and standing or sitting affected the CenterEyeAnchor’s y value between 1.1-1.7. The 1.02 is affected by my floorGameObjectCube being 0.02 yScale and at -.02 yPosition.
The fix is to get the TrackingSpace adjusted to offset the OVRManager’s height.
Set your OVRManager’s GameObject inspector’s y value to the play mode’s calculated slight variation height, in my case 1.02
and add this script to you OVRManager’s GameObject:
void Start()
{
// When OVRManager is set to Floor Level, use this so the guardian base is lowered to sit at the scene's floor
// rather than being ~1 meter too high
GameObject tracker = GameObject.Find("TrackingSpace");
Vector3 guardianOrigin = tracker.transform.position;
guardianOrigin.y -= gameObject.transform.position.y; // Reads from the awake init value before Oculus liveCalculates it (not dependent on actual head motion)
tracker.transform.position = guardianOrigin;
}