Bug (probably?): Camera Offset manipulation and UI (/general?) interaction


I’m used to being able to tweak the player’s starting position using the Camera Offset component within the XR Origin prefab (which, in itself, always stays at world origin of course). This seems to work well for other hardware, so I assumed it would be the case for the AVP.

I just tracked a very nefarious behavior wherein UI interaction worked in editor but not in the XCode simulator (and presumably, on device) down to the fact that camera offset’s transform was changed. What’s extra tricky is you still see the UI components - just can’t interact with them, presumably because the “target ray” is not offset appropriately?

When I reset camera offset back to zero, UI interaction works again both in editor and in simulator. (I haven’t extended the tests to non-UI interactions but my working assumption would be this behavior extends to everything that relies on raycasts).

Easily reproable with the immersive sample scenes, whether the UI-centric one or the general one.

Screenshot 2024-01-25 at 11.56.24 AM

Thank you!

Can you please filea bug and report the incident id here? Thank you.


Regarding the XR Origin and CameraOffset, I think you will find you get similar behavior to what you’re describing by simply adding your VolumeCamera component to the Camera Offset GO.

Let me know if that works for you!

Thanks Tim - to clarify, I’m working on an immersive app and currently have no VolumeCamera component in the scene (in fact, I have no volume!)

Did you mean to say I should add one?

This is just an oversight in our sample content. As you say, the ray interactor and ray origin transforms should be under the camera offset transform. I just hadn’t tested moving the XR Origin or camera offset around to different locations. We’ll fix this up for the next release.

1 Like

I’m confused by this solution. I made these changes to stock VisionOS XR Plugin sample:

  1. Reparent the Ray Interactor and Ray Origin transforms under the CameraOffset transform.
  2. Set the the y-positions of the following transforms:
    CameraOffset: 1.5
    Collider Target: 1.5
    Sample Canvas: 1.75
    Grab Interactable Left: 1.4
    Grab Interactable Right 1.4

With this setup, when the sample is run in the Editor, the Ray Interactor and Ray Origin have additive y-offsets to the CameraOffset so they are twice the height of the camera plus their local offset.

If I parent the Ray Interactor and Ray Origin back to their original location under XRI with identity positions, then they maintain their proper positions when the scene us run.

This appear to be the opposite of the solution above?

Do you know if this is fixed yet? Or know if there are any temporary solutions

Hey! Sorry for the delayed reply here. Without any changes to the sample C# scripts, this is what I would expect to see. The solution is to change the parent of these objects and modify the scripts to set their transforms in local space instead of world space. The 1.1 version of the package should be out any day now, and you’ll see what I mean. :slight_smile:

I’m on Apple VisionOS XR Plugin 1.1.4 and still seeing a similar problem. In the Main Sample scene, when I build and deploy to device in “Virtual Reality - Fully Immersive Space”, the UI appears at my feet. It appears as if the Main camera is being offset by the distance that AVP detects from the floor to device.

This happens whether XR Origin → “Tracking Origin Mode” is set to to “Device”, “Floor”, or “Not Specfied.” “Camera Y Offset” appears to have no effect and any change to “XR Origin”'s position, is just added on top of AVP’s distance from the floor.

“Device” origin works as expected on other devices, but appears to be ignored by AVP.

This literally just happened to me tonight and I didn’t make any code changes on my side. Something must be up with Play to Device 1.1.4 because it all of the sudden Play to Device for the simulator (and real device) just ignored my CameraOffset value in my XR rig.

I solved my own problem (again). A rogue Volume Camera made its way into the scene without me knowing it :man_facepalming:t2: