# Pointer triggered UI button not working

**URL:** <https://forum.magicleap.cloud/t/pointer-triggered-ui-button-not-working/3546>\
**Category:** Unity Development\
**Tags:** getting-started, xri\
**Created:** [May 20, 2024, 5:29pm UTC](https://forum.magicleap.cloud/t/pointer-triggered-ui-button-not-working/3546 "2024-05-20T17:29:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kritig](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kritig](https://forum.magicleap.cloud/u/kritig)\
**Post date:** [May 20, 2024, 5:29pm UTC](https://forum.magicleap.cloud/t/pointer-triggered-ui-button-not-working/3546/1 "2024-05-20T17:29:48Z")

</div>

Give us as much detail as possible regarding the issue you're experiencing:

**Unity Editor version** : 2022.2.12f1  
**ML2 OS version** : 1.12.1  
**Unity SDK version** : 2.2.0  
**Host OS** : Windows 11

I am new to Magic Leap, so I'm struggling to do some basic things. Right now, I am trying to make a UI button that can be triggered by the controller pointer. I have tried to follow the Magic Leap Unity Examples project and have used the same UI button scripts from there. However, the pointer events are not detected. I'm wondering if this is an issue with how I set up the button or if it is because I haven't set up the controller pointer properly. Whenever I build to the headset, the ray from the controller displays as red, which I'm not sure is the expected behavior.

I've included screenshots of my button setup and Controller:

 ![Screenshot 2024-05-20 122454](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/7/7d278f1049b5270d797ed19c9c14bbf051df2d3b.jpeg)  
 ![Screenshot 2024-05-20 122610](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/f/f8f5801657fcce05d89e75f08ba397b520964af4.png)  
 ![Screenshot 2024-05-20 122635](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/7/70cc5426a69f1ab2f685960023128787fea50a2b.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:** [May 20, 2024, 8:34pm UTC](https://forum.magicleap.cloud/t/pointer-triggered-ui-button-not-working/3546/2 "2024-05-20T20:34:19Z")

</div>

@kritig Welcome to the Developer Forum. I recommend using XRI's input and event's directly.

[https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.2/manual/ui-setup.html](https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.2/manual/ui-setup.html)

You can also use a standard 3D Canvas with the UI Button component. (GameObject \> XR \> UI Canvas) . Then use the standard UI components from Unity.

These instructions might help you get started.

> **[Simple Grab Interaction | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/unity/getting-started/unity-simple-interaction/)**
>
> This document provides step-by-step instructions on how to create a cube that can be selected, grabbed and manipulated using Unity's XR Interaction Toolkit and the sample scene created in the Building a Simple App guide.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/bd9b737a4d45ea243aa7eb177d60a773b806899a.svg) [@system](https://forum.magicleap.cloud/u/system)\
**Post date:** [June 4, 2024, 8:35pm UTC](https://forum.magicleap.cloud/t/pointer-triggered-ui-button-not-working/3546/3 "2024-06-04T20:35:04Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
