I am developing a mobile ar application for android with Unity and AR Foundation. My current task is to implement the features scaling, rotating and dragging for 3d objects in the scene. While doing research I came across XRI in Unity. So I installed it and added the interactable components to my object, like ARSelectionInteractable
, ARTranslationInteractable
, ARRotationInteractable
and ARScaleInteractable
.
Those are visually working fine. In my case I need a feedback after I finish scaling, so I looked up and saw that there are many Interactable Events
I can use. I subscribed to all events, although I only need the SelectExit(SelectExitEventArgs args)
, just to check if my implementation works and realized that none of them are triggered and I don’t know why. I looked in the documentation up if my project is correctly setup.
What I did by reading the documentation was:
XR Origin
XRScreenSpaceController
, XRRayInteractor
and XRInteractionGroup
(but I'm not sure if I really need them)ARGestureInteractor
to the Main Camera
XRInteractionManager
XRUIInputModule
next to EventSystem
and removed old Input System UI Input Module
DefaultInputAction
from AR Foundation to default XRDefaultInputActions
from XRII suspect that it is due to the setup of XRI. Maybe I’m missing something important regarding the EventSystem?
Hierarchy (with screenshots):
Version of Tools
To keep the post short, I'll only show a few lines of the subscription to the event:
public void SelectEnter(SelectEnterEventArgs args)
=> Debug.Log("SelectEnter");
public void SelectExit(SelectExitEventArgs args)
=> Debug.Log("SelectExit");
I fixed my issue by updating to the newest pre-version. I guess not using a rigidbody on the object that I manipulate might be the reason. Because before I didnt use it and I didnt want to use it, because in my understanding I dont need it if I dont use the physics engine. But in the newest XRI version the rigidbody is a must and cant be deleted. So maybe that was the reason.