Introducing UIDragDetectors [Studio-only Beta]

The performance losses dont seem to be that crazy. Something else i found is that having a ton of ui instances with ui drag detectors parented into them will cause the client to freeze briefly every time you try dragging one instance out of the pile. This is probably even less of an performance issue since yknow, unlikely any game is going to have like over 1000 draggable instances be held in the exact same position.

5 Likes

Itā€™s on a plugin so it should run without needing to play

3 Likes

Ah, at the moment, if a plugin is active, dragging is disabled. I believe that may be the reason.

We are looking into a better solution-- perhaps to disable the dragging only when the mouse is taken by a plugin or a tool (such as the Select, Move, Rotate, Transform tools, or the UIEditor plugin).

5 Likes

unlikely any game is going to have like over 1000 draggable instances be held in the exact same position.

Donā€™t jinx it :upside_down_face:

Weā€™ll take a look at such cases when we have the bandwidth to see if itā€™s a real issue / if anything can be improved-- otherwise, some performance effects are expected. Please do let us know if you find cases where regular usage causes a significant issue!

6 Likes

I see, personally i was expecting for that sort of use case to work without any code changes. I cant exactly pull off any hacky ways of doing this like first idea you proposed since it would mean also changing some of the code to account for the new parent.
The second and third hack are right now not exactly good enough for my use case mostly because i do myself have my own draggableā€™s system which does not have any of the performance issues i had talked about earlier. While no doubt the second method would look nicer i still would rather use my system until the performance issues get addressed. They arenā€™t anything game breaking or whatever but they do feel pretty bad to look at and use, especially on higher refresh rates.
Again, i was mostly interested in the idea if i could have that sort of behavior without any code changes.

3 Likes

Yeah, thatā€™s definitely understandable! Itā€™s definitely a use case that isnā€™t covered without scripting, but itā€™s something that can be looked into in the future.

Weā€™ll be mentioning any performance improvements in the update logs, so hopefully itā€™ll be within an acceptable range sooner or later.

2 Likes

I definitely feel you lol
I spent a good few hours on a button drag system just yesterday, and next thing I know roblox just adds an entire instance that solves everything I put my work into :sob:

3 Likes

This is so useful. Great update!

2 Likes

How would this work with UI frameworks like React? Would there be an API we could listen to?

Also, my primary use-case for this would be for my inventory system. If I could use a UIDragDetector to drag an inventory item out of the item grid in order to detect when to drop it onto the ground, Iā€™d be able to delete the entirety of my custom dragging code.

Hereā€™s a visual example of what Iā€™m referring to:

78711cc198fdff20132a97c0c005a60b

8 Likes

Found a potential issue with the UIDragDetector: I set the DragAxis property to (0, 0) and produced this result:

Screenshot 2024-08-10 020550

I canā€™t change the numbers back, so the property is perpetually stuck like this unless thereā€™s a brand-new detector to replace it with.

3 Likes

This is awesome, seeing the drawbridge gif gives me ideas for if i ever get around to doing my game idea, it involves puzzles etc and this would be a great way to make some of them.

1 Like

Thatā€™s wierd cuz I replaced the drag script from the main core Gui widget with a ui dragdettector and I can drag the core Gui widget around (with the script if you started dragging it moves the core Gui widget to left before you get good grip on it) but now it drags smooth

2 Likes

Oh, finally, I wrote it myself~~~~

1 Like

This is incredible! I have had many issues in the past with trying to make draggable elements on SurfaceGuis and seeing an actual feature for them is such a relief. I canā€™t wait to test this out!

1 Like

okay so ive seen people exploit their currency or ā€œclicksā€. wouldnt this act like a debounce and stop that?

adding this completely removes the use of the remoteevents (for some parts in a simulator game) as the drag ui itself can act as a value placement upon each drag.

you can do the same via script and text buttons without events but this would require you to force yourself to move the drag rather than exploiting?

could be wrong.

1 Like

The perfect update has arrived! Canā€™t wait to use this

1 Like

I was always thinking about how to create a system like that with code, regardless of language.

I guess Roblox did it for us now. :person_shrugging:

Yet, I wonder about the details, so that I know how onewould create a system like that as well. Not sure what it would be called.

2 Likes

This is an amazing update, I cant wait to use this!

2 Likes

This is geniunely an incredible update. Iā€™m loving all of these UI related things being added! :smile:

Perhaps we could have a UIBlur in the future? :eyes:

7 Likes

This is a really useful feature that the community have been waiting some time for. Itā€™ll make workflow much more time efficient and push out better quality features, thanks to the team for building it into the engine!

1 Like