OnPointerDown/OnPointerUp working but OnBeginDrag/OnEndDrag not working

Hello,
I have a class with all four of these. One minute they were working all day, the next minute, after I merged with another branch, the drag handlers stopped working. I tried to go back to an earlier commit and they aren’t working there anymore either. Has any body run into this issue before? Even now the pointer up and pointer down handlers work but the drag handlers don’t

Here’s a test I made:

using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using System.Collections;
using InitAndPlay;

public class DetectTouch : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IBeginDragHandler, IEndDragHandler {
    #region IPointerDownHandler implementation
    public void OnPointerDown (PointerEventData eventData) {
        Log.Add("pointer down - this works");
    }
    #endregion
   
    #region IPointerUpHandler implementation
    public void OnPointerUp (PointerEventData eventData) {
        Log.Add("pointer up - this works");
    }
    #endregion

    #region IBeginDragHandler implementation

    public void OnBeginDrag (PointerEventData eventData) {
        Log.Add("begin drag - this doesn't work...it used to");
    }

    #endregion
   
    #region IEndDragHandler implementation
    public void OnEndDrag (PointerEventData eventData) {
        Log.Add("end drag - this doesn't work...it used to");
    }
    #endregion
}

Any help would be greatly appreciated!

Thanks!

Nevermind… apparently I had to implement IDragHandler as well. I had that in there in between commits but apparently I deleted it! ugh.

6 Likes

Haha ty for posting the solution. I had the same problem :stuck_out_tongue:

I had the same problem thanks!