I have the following attached to a character with BoxCollider2D and Rigidbody2D components attached:
public void OnDrag (PointerEventData data) {
gameObject.rigidbody2D.isKinematic = true;
float x = data.worldPosition.x;
float y = data.worldPosition.y;
transform.position = new Vector3 (x + offset.x, y + offset.y, 0f);
}
public void OnDrop (PointerEventData data) {
gameObject.rigidbody2D.isKinematic = false;
}
If I drag too fast then it seems that the pointer is outside the collider region and the OnDrag handler is no longer called. Moving the pointer back inside the collider region allows the events to resume.
Is this a bug or should I be handling this situation somehow?