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

**URL:** <https://forum.magicleap.cloud/t/when-i-am-using-camera-capture-my-unity-scenes-drop-from-the-view/4706>\
**Category:** Unity Development\
**Tags:** development, unity\
**Created:** [December 2, 2024, 7:16pm UTC](https://forum.magicleap.cloud/t/when-i-am-using-camera-capture-my-unity-scenes-drop-from-the-view/4706 "2024-12-02T19:16:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![psyje6](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@psyje6](https://forum.magicleap.cloud/u/psyje6)\
**Post date:** [December 2, 2024, 7:16pm UTC](https://forum.magicleap.cloud/t/when-i-am-using-camera-capture-my-unity-scenes-drop-from-the-view/4706/1 "2024-12-02T19:16:45Z")

</div>

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):

---

<div class="post-metadata">

**Author:** ![aheaney](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@aheaney](https://forum.magicleap.cloud/u/aheaney)\
**Post date:** [December 2, 2024, 9:27pm UTC](https://forum.magicleap.cloud/t/when-i-am-using-camera-capture-my-unity-scenes-drop-from-the-view/4706/2 "2024-12-02T21:27:55Z")

</div>



---

<div class="post-metadata">

**Author:** ![aheaney](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@aheaney](https://forum.magicleap.cloud/u/aheaney)\
**Post date:** [December 2, 2024, 11:23pm UTC](https://forum.magicleap.cloud/t/when-i-am-using-camera-capture-my-unity-scenes-drop-from-the-view/4706/3 "2024-12-02T23:23:12Z")

</div>

Hello,

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

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/5/5b02e3b8c340d1b67ccb3fd57102fc84ec304883.png)

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-

> **[Reference Space Overview | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/unity-openxr/reference-space/reference-space-overview/)**
>
> Reference Spaces are different methods of defining the origin and orientation of the coordinate system used by the device within your application. They affect how the device tracks the position and rotation of the user and the environment. Different...

Best,  
Adam

---

<div class="post-metadata">

**Author:** ![psyje6](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@psyje6](https://forum.magicleap.cloud/u/psyje6)\
**Post date:** [December 3, 2024, 7:18pm UTC](https://forum.magicleap.cloud/t/when-i-am-using-camera-capture-my-unity-scenes-drop-from-the-view/4706/4 "2024-12-03T19:18:11Z")

</div>

> [@aheaney](#):
>
> use it to be positione

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:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/5/50f4d88a876c859100ace431119706f2ba9e8394.png)

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [December 3, 2024, 7:48pm UTC](https://forum.magicleap.cloud/t/when-i-am-using-camera-capture-my-unity-scenes-drop-from-the-view/4706/5 "2024-12-03T19:48:56Z")

</div>

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.

> **[MLCamera | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/unity-openxr/ml-camera/#using-mlsdk-perception-pose-data)**
>
> The Magic Leap 2 MLCamera API allows developers to capture real and virtual content inside their applications. While the Magic Leap 2 has only one camera for capturing content, two separate streams can be access from the camera at the same time. This...

---

<div class="post-metadata">

**Author:** ![psyje6](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@psyje6](https://forum.magicleap.cloud/u/psyje6)\
**Post date:** [December 5, 2024, 11:23am UTC](https://forum.magicleap.cloud/t/when-i-am-using-camera-capture-my-unity-scenes-drop-from-the-view/4706/6 "2024-12-05T11:23:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [December 5, 2024, 4:42pm UTC](https://forum.magicleap.cloud/t/when-i-am-using-camera-capture-my-unity-scenes-drop-from-the-view/4706/7 "2024-12-05T16:42:58Z")

</div>

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.

> **[Unity Discussions](https://discussions.unity.com/)**
>
> The Unity Discussions (previously Unity Forums & Unity Answers) is a place for you to ask questions, discuss, help others, and get help from peers regarding Unity development.
