How to interact with UI button with Magic Leap 2 Trigger button

Hi everyone,
I want to move the model in scene in X,Y,Z direction respectively with the help of the buttons click (UI buttons in canvas) using trigger button of magic leap controller. How can I do this?
Below is the my UI Canvas and Hierarchy for your reference.

I want to add more information.
I am using below link for marker tracking and placing the CAD model according to marker posture.
MagicLeapMarkerTracking
After placing the model successfully, I want to translate the model in 3-axis with the help of the 6 buttons (3 for positive translation and 3 for the negative translation) created in UI for the adjustment purpose(I am using XR canvas and I already confirmed that with the trigger, the button will work). My unity screen is like this.
Uploading: image.png…
How can I move the model placed with the marker tracking with button click?
Any suggestions and additional script within the marker tracking example will be highly appreciated.

Hi @acharya,

There are many ways to interact with the UI. If you want to take the easier route, I can recommend the Magic Leap MRTK3 Package. This package offers several tools that make interactions in XR quick and easy.

If you are using the default XR Rig prefab in your scene. You can use the controller raycast to click on worldspace canvases. You can attach the TrackedDeviceGraphicRaycaster component to the canvas as well. This should allow the controller to interact with the UI.

Hi @etucker,
I already able to interact with UI button with controller. I am sorry as I couldnot explain what wanted to do properly earlier. With the marker tracking example, I am able to place the model on top of the marker. Now, what I want to do is to move the same model placed with the help of marker tracking into X,Y,Z direction respectively with the help of button click.


I am thinking to write some script to move the model but don't know how to implement those script to move the model placed with the help of marker tracking ?

Hi @etucker
I am able to move the object. We can close this topic.