Delay with Drag & Drop (Widgets)?

Delos-X
Fri, 28 Dec 2018 15:30:04 +0000
UI

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.

https://i.gyazo.com/da89ec1adad744484b6a9f4259ff7029.mp4

There’s two solutions I can think of but I’m not sure how to achieve them:

1. Set DragWidget’s position to the center of the mouse when the drag begins, instead of the location of the health bar.

2. Remove the delay with drag, so it instead snaps to the mouse instantly.

So how do I fix this delay/lag?

2 posts - 2 participants