Skip to main content
Inspiring
December 19, 2023

Meta XR Interaction SDK v60 data from pointer event is null

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?

 

    This topic has been closed for replies.

    1 reply

    BigFlex
    Meta Employee
    February 1, 2024

    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.