# UI Toolkit and ML Rig

**URL:** <https://forum.magicleap.cloud/t/ui-toolkit-and-ml-rig/6518>\
**Category:** OpenXR\
**Created:** [October 28, 2025, 6:04pm UTC](https://forum.magicleap.cloud/t/ui-toolkit-and-ml-rig/6518 "2025-10-28T18:04:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michel.comin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/michel.comin/32/2615_2.png) [@michel.comin](https://forum.magicleap.cloud/u/michel.comin)\
**Post date:** [October 28, 2025, 6:04pm UTC](https://forum.magicleap.cloud/t/ui-toolkit-and-ml-rig/6518/1 "2025-10-28T18:04:54Z")

</div>

Hi there,

I’ve been trying to use UI Toolkit with Magic Leap 2 recently and I’ve found some issues while using the default ML Rig Prefab. As it is right now, it seems like ML Rig Controller Game Object doesn’t interact with the new UI Toolkit. Is there something missing or am I doing something wrong? From our observations, it seems like it might need the NearFarInteractor.

thank you in advance!

**Unity Editor version** (if applicable): 6.2  
**MLSDK version** : 2.6.0

---

<div class="post-metadata">

**Author:** ![cfeist](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/cfeist/32/1768_2.png) [@cfeist](https://forum.magicleap.cloud/u/cfeist)\
**Post date:** [October 28, 2025, 6:13pm UTC](https://forum.magicleap.cloud/t/ui-toolkit-and-ml-rig/6518/2 "2025-10-28T18:13:53Z")

</div>

Hey @michel.comin ,

Welcome to the Magic Leap Forums!  
Sorry you’re running into issues!

To my knowledge, the ML Rig Controller object just needs to have an XR Ray Interactor script on it to enable interactions with UI Components. As long as those UI components can receive raycast interactions, it should be working.

For an example, you can check out the Magic Leap Examples project for Unity.  
You can download this project from the MLHub.  
Here’s documentation on how to get and setup the project if you like:

> **[Install and Setup SDK Examples | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/unity/sdk-example-scenes/sdk-install-setup/)**
>
> This section describes how to download and configure the Magic Leap Unity Example project.

Best,  
Corey

---

<div class="post-metadata">

**Author:** ![michel.comin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/michel.comin/32/2615_2.png) [@michel.comin](https://forum.magicleap.cloud/u/michel.comin)\
**Post date:** [October 29, 2025, 6:33pm UTC](https://forum.magicleap.cloud/t/ui-toolkit-and-ml-rig/6518/3 "2025-10-29T18:33:07Z")

</div>

Hi cfeist,

Just to be clear I’m talking about the new way of doing UI using UI Toolkit. For this new components of UI (that don’t use canvas) the XR Ray Interactor doesn’t work. You can see the actual differences in the XR Interaction Toolkit sample “World Space UI” where they have both UIs (new and old) side by side.

I managed to have it working doing some changes to your ML Rig:

- Disable all the other scripts of Controller object and (including Line renderer) and adding XR Interaction Group.
- Add a child GameObject to controller named “near-far interactor” which has the Near-Far Interactor script, Interaction Attach Controller script, Sphere interaction caster and curve interaction caster script
- Inside the Near-far interactor, add another gameobject with the linevisual, which has a line renderer and a curve visual controller script

there might be a better way, but I based in on that XR Interaction Toolkit sample and this seems to work (besides some weird behavior with the line).
