When I am using camera capture my unity scenes drop from the view

I am creating an AR application using object detection and so I need camera access, but whenever I am taking camera input to feed to my model, the text view scene I have on screen drops below view height to the floor and I am not sure why. I have tried this using the User Interface example provided on github but the same thing happens.

Please send any help or advice my way!!

Unity Editor version: 2022.3.42f1
ML2 OS version: 1.8.0
Unity SDK version: 2.5.0
Host OS: MacOS

Error messages from logs (syntax-highlighting is supported via Markdown):

Hello,

Welcome to the developer forums! By any chance do you have the tracking origin mode on your XROrigin component set to floor?

That setting determines the OpenXR reference space that is used to control how the origin is positioned in space. The floor behavior should cause it to be positioned on the floor. Changing it to Device will use OpenXR LOCAL space instead, which will not automatically snap the origin to the floor.

Article on OpenXR reference spaces in Unity-

Best,
Adam

1 Like

Hi Adam,

Thank you so much for replying, I'm really new to this. I'm using XROrigin and the Tracking Origin Mode is set to Device.

This is what it looks like:

I was not able to reproduce the issue that you are experiencing. It may be related to how you configured your script/scene.

Have you tried using the latest Magic Leap Examples Project that can be obtained from the Magic Leap Hub? If you are trying to obtain the Pose from the Camera- make sure to enable perceptions snapshots as mentioned in the Developer Documentation.

Hi,

Thank you for replying, the project I'm running is from the Magic Leap examples. I am running a Yolo object detection model in my project and the problem I'm experiencing only persists when the model is running. The only thing I'm doing right now is displaying a user interface, taking camera input and putting it through the model to display what object is being detected.

Since the issue can only be reproduced when the model is running you may want to ask about more information on Unity's discussion/fourm or stack overflow.