I have 2 prefabs objects consisting in a panel with UI.Text inside. One contains the class for dragging and the other the dropping. However, even if the drag works fine the OnDrop() function is never executed. I have also set the blockRaycasts to false in the CanvasGroup that I added to the main Canvas.
GetComponentInParent<CanvasGroup>().blocksRaycasts = false;
Are there any reasons why the method OnDrop() implemented from the interface UnityEngine.EventSystems.IDropHandler may not be firing while I'm dragging an object into it?
public class ItemDropHandler : MonoBehaviour, IDropHandler
{
public void OnDrop(PointerEventData eventData)
{
Debug.Log("Drop detected over the UI.Text"); //this is never shown
}
}