Introducing UIDragDetectors [Studio-only Beta]

Interesting-- we’ll definitely be looking into performance enhancements over time, but hopefully it’s not too big of an issue at the current state.

@mantorok4866 As shown by @XenoDenissboss1 , there does seem to be possible performance effects. If your custom dragger is simple in logic, it’s definitely possible to be better in performance.

We will be improving upon this over time.

2 Likes

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.

3 Likes

It’s on a plugin so it should run without needing to play

2 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).

3 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!

4 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.

2 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

7 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.

1 Like

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

1 Like

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