Can someone explain why PointerEventData.pointerCurrentRaycast is null, when i get PointerEventData during public void OnPointerExit(EventSystems.PointerEventData eventData);
In documentation i can find “PointerEventData.pointerCurrentRaycast : RaycastResult associated with the current event.”
And event triggered when i Pointer Exit some object, logicaly event “exit” is associated with this object. But pointerCurrentRaycast is null, and i can’t determinate which object pointer exit.
I’m guessing because when you’re not on an object, the raycast is by definition not hitting any object to return to you!
Instead, keep a reference of what object the pointer was on last frame, and when you are no longer on it, look at that last object and make your appropriate decisions from that.