Hello,
I’m trying to implement drag’n’drop functionality in runtime for a button. So, according to this , I need to register a VisualElement for mouse events to make it draggable. Since it’s in runtime for a game, I went for pointer events instead. Here’s what I do:
if (_draggable) {
mainButton.RegisterCallback<PointerDownEvent>(PointerDown);
mainButton.RegisterCallback<PointerMoveEvent>(PointerMove);
mainButton.RegisterCallback<PointerUpEvent>(PointerUp);
}
The problem: when I start trying to drag the button, I get PointerMove calls and PointerUp call when I release the mouse. But PointerDown never gets called.
Why? Is there a way to receive it?