Forum Discussion
LePython
2 years agoExplorer
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?
1 Reply
Replies have been turned off for this discussion
- Big_FlexMeta Employee
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.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 5 months ago