cancel
Showing results for 
Search instead for 
Did you mean: 

Meta XR Interaction SDK v60 data from pointer event is null

LePython
Explorer

Hi,

After updating to interaction sdk v60, I get an error when trying to obtain a collision like so:

public void OnPointerMove(PointerEvent pointerEvent){
        if(!rayInteractableEvent.enabled) return;
        RayInteractor handRayInteractor = pointerEvent.Data as RayInteractor;
        if (!handRayInteractor.CollisionInfo.HasValue) {
            return;
        }

 

handRayInteractor is null and undefined the compiler says. I haven't changed anything in my code, just updated the sdk. In release notes it says that a case where 'data' could be null was fixed, but I now have the exact same problem. Has the way of getting data changed or am I missing something else from this update?

 

1 REPLY 1

Big_Flex
Expert Protege

Hi @LePython,

Here's the official tutorial on using Data, though at first glance I don't see anything wrong with your code. Could you tell me more about the scenario? If you just want to detect a collision, you could put an InteractableUnityEventWrapper on your detectable object.