Introducing UIDragDetectors [Studio-only Beta]

This is great! I’ve been hoping for something like this for a while.

Is this high or low priority? I’m hoping high priority, because this would very much streamline the process of making things like inventories and lists (examples being the roblox backpack and blender’s modifier stacks.)

I’d personally be using it to make a custom inventory, since the default backpack has no way to save the layout/contents of the inventory between respawns without hacky solutions. Having to implement custom drag just so I can create a new inventory is going to be infuriating and tedious.

1 Like

The next generation of Draggable???

2 Likes

All the work put into slider modules ->🚪 (Nonetheless they served their purpose for their time)

when changing the parent of something or the position of something on DragStart event it will just completely cancel the drag. this makes for example taking items in an inventory (that obviously uses some sort of UILayout) impossible.

https://devforum.roblox.com/t/new-uidragdetectors-just-stops-drag-if-you-change-guiobject-parentposition-upon-dragstart/3115189

At the moment, it doesn’t quite support Layouts (meaning any current behavior may be changed).

For the use case you mentioned, however, you could probably hook something up to the DragEnd event to see if the mouse cursor coordinates that the drag ended on (which is provided as an argument to the event) is over the Gui you want (the menu), and hook some behavior to it accordingly.

Uh oh. Noted-- We’ll fix it as soon as possible!

2 Likes

Not quite sure what you mean-- are you thinking about using the dragStart/Continue/End events to detect time between the events to use as a debounce of some kind?

That could definitely work, though it wasn’t the intended use case. Using a custom ResponseStyle would do all the dragging behaviors without moving the UI, so it could indeed be used like that by storing the time between DragStarts / Ends, or something like that.

DragContinue would only be triggered if the input moved after the start, so it might not feel great to use.

1 Like

As mentioned in this reply, there is a way to do this-- it’s not the easiest and does require code, but it’s not too complicated either.

DragUDim2 is supposed to be the change in position during the current drag, so it would reset between drags. If you want to keep it consistent over multiple drags, set the ReferenceUIInstance to a different GuiObject-- DragUDim2 will be the translation from the reference at all times in that case.

Regarding the second edit, do you have a video of what you mean? I’m not quite sure I understand, and I wanted to make sure if it’s a bug or not.

1 Like

If you could let us know of some of the issues with the mobile devices, I’ll get to it!

We are currently aware of the big black indicator that pops up in the wrong location right now :upside_down_face:

Note: Did I mention you should be able to drag two different UIDragDetectors at once on mobile?

3 Likes

I’ll take a look at this as soon as possible. Thank you!

2 Likes

Could you attach a video of this happening?

There are some known issues with cursors at the moment that will be addressed next week, but I want to know if there are other issues that we need to deal with!

:cold_sweat: We will file a bug ticket for this if we can reproduce this issue-- sounds like a bug.

We are hoping to have this behavior before we go out of beta, but please note that plans are subject to change :upside_down_face:

Ancestry changes during drag does terminate drag, so it looks like that’s what is happening in the video.

Layout support is a planned feature, and we didn’t think about cases where ancestry changes during the drag might actually be desired in some cases-- we will note this and discuss a solution.

As a workaround, perhaps it’s possible to use a Custom ResponseStyle to keep the original UI from being moved, clone the UI you want to “drag and drop” and make it somewhat transparent, and destroy it on drag end, while running logic on the original UI during those events, too?

It’s definitely not a pretty workaround and we will find a solution for it, but I don’t think there’s a solution for changing ancestry during a drag at this time.

1 Like

This looks great cant wait to try it!

1 Like

By rotate I mean that the default cursor when you hover/click on a draggable element is slanted. Like it’s a hand that is at an angle. this feels terrible to use

1 Like

This is awesome, so much easier now

1 Like

so is the core backpack going to be remade to use this instead of Draggable?

3 Likes