Heya,
So I’ve been following this tutorial to create a simple drag and drop UI element. Part of my version is that the DragWidget representation (in the tutorial, it’s DragWidget) is smaller than the widget being dragged (Healthbar in the tutorial). However, when the drag is started, the DragWidget’s starting location is offset to the Healthbar was located. To counter this, I set the drag pivot to be Center Center instead of Mouse Down within the ‘Create WidgetDrag’. However, when I do that, it has a delay before snapping to the center of the mouse location.
I’ve been referring to things as if they have the same names and visuals as the tutorial, but obviously I’m just applying it to my own stuff. Oh, I’ve also set the ‘HealthBar’ to be invisible when dragging. Here’s a video of the issue.
There’s two solutions I can think of but I’m not sure how to achieve them:
- Set DragWidget’s position to the center of the mouse when the drag begins, instead of the location of the health bar.
- Remove the delay with drag, so it instead snaps to the mouse instantly.
So how do I fix this delay/lag?